Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build && mv ./_redirects ./dist/_redirects",
"lint": "vue-cli-service lint",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit",
Expand Down
29 changes: 18 additions & 11 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vue.use(VueAxios, axios)

let github_apiURL = 'https://api.github.com/repos'
//let path = '/repos/ChallengeHunt/challengehunt'
const Backend_API_URL = 'http://127.0.0.1:5000/api'
const Backend_API_URL = 'https://dribdat2.herokuapp.com/api'

export default new Vuex.Store({
state: {
Expand Down Expand Up @@ -110,27 +110,34 @@ export default new Vuex.Store({
},
loadProject ({ commit }) {
axios
.get('http://127.0.0.1:5000/api/project/' + '1' + '/info.json')
.get(`${Backend_API_URL}/project/1/info.json`)
.then(r => r.data)
.then(project => {
commit('SET_PROJECT', project)
})
},
loadCustomProject ({ commit }, id) {
loadCustomProject({commit}, id) {
axios
.get('http://127.0.0.1:5000/api/project/' + id + '/info.json')
.get( `${Backend_API_URL}/project/${id}/info.json`, {
method: 'GET',
mode: 'no-cors',
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
}
})
.then(r => r.data)
.then(custom_project => {
commit('SET_CUSTOM_PROJECT', custom_project)
})
},
loadProjectList ({ commit }, event) {
loadProjectList({commit},event) {
let eventId = event || 'current'

var url = `${Backend_API_URL}/event/${eventId}/challenges.json`
var url = `${Backend_API_URL}/event/${eventId}/projects.json`

if (eventId === 'current') {
url = `${Backend_API_URL}/event/current/challenges.json`;
if(eventId === 'current'){
url = `${Backend_API_URL}/event/current/projects.json` ;
}

axios
Expand All @@ -143,14 +150,14 @@ export default new Vuex.Store({
}
})
.then(response => {
commit('SET_PROJECT_LIST', response.data.challenges)
commit('SET_PROJECT_LIST', response.data.projects)
})
},
setModeEdit ({ commit }) {
setModeEdit({commit}){
commit('SET_EDITABLE', true)
},

setModeDisplay ({ commit }) {
setModeDisplay({commit}){
commit('SET_EDITABLE', false)
},
setProjectProgress ({ commit }, progress) {
Expand Down