Fix axios and server setup

This commit is contained in:
Kevin Thomas
2021-08-08 23:52:44 -07:00
parent cd6af207be
commit ad810beea9
15 changed files with 17131 additions and 110 deletions

View File

@@ -82,7 +82,7 @@ export default {
},
methods: {
getUsers () {
this.$http.get('https://localhost:3000/users')
this.$http.get('/users')
.then(response => {
if (response.status === 200) {
this.users = response.data.users
@@ -93,8 +93,8 @@ export default {
})
},
updateUser (id, isAdmin) {
this.$http.patch('https://localhost:3000/users/'.concat(id), {
isAdmin: isAdmin ? 1 : 0
this.$http.patch('/users/'.concat(id), {
isAdmin: isAdmin
})
.then(response => {
if (response.status === 200) {
@@ -107,7 +107,7 @@ export default {
})
},
deleteUser (id) {
this.$http.delete('https://localhost:3000/users/'.concat(id))
this.$http.delete('/users/'.concat(id))
.then(response => {
if (response.status === 200) {
this.getUsers()

View File

@@ -81,7 +81,7 @@ export default {
this.$router.push('/admin')
},
logout () {
this.$http.get('https://localhost:3000/logout')
this.$http.get('/logout')
.then(response => {
if (response.status === 200) {
this.$router.push('/login')
@@ -92,7 +92,7 @@ export default {
})
},
openDrawyer () {
this.$http.get('https://localhost:3000/users/current')
this.$http.get('/users/current')
.then(response => {
if (response.data.user.isAdmin) {
this.isAdmin = true

View File

@@ -60,7 +60,7 @@ export default {
}),
methods: {
login () {
this.$http.post('https://localhost:3000/login/password', {
this.$http.post('/login/password', {
username: this.username,
password: this.password
})

View File

@@ -70,7 +70,7 @@ export default {
}),
methods: {
register () {
this.$http.post('https://localhost:3000/users', {
this.$http.post('/users', {
name: this.name,
username: this.username,
password: this.password,

View File

@@ -133,7 +133,7 @@ export default {
}
},
populateProfileItems () {
this.$http.get('https://localhost:3000/profiles')
this.$http.get('/profiles')
.then(response => {
if (response.status === 200) {
this.profileItems = response.data.profiles
@@ -144,7 +144,7 @@ export default {
})
},
saveProfile () {
this.$http.post('https://localhost:3000/profiles', {
this.$http.post('/profiles', {
name: this.profileName,
isTimerEnabled: this.isTimerEnabled,
duration: this.duration,
@@ -169,7 +169,7 @@ export default {
this.populateProfileItems()
},
loadProfile () {
this.$http.get('https://localhost:3000/profiles/'.concat(this.selectedProfile.id))
this.$http.get('/profiles/'.concat(this.selectedProfile.id))
.then(response => {
if (response.status === 200) {
const profile = response.data.profile
@@ -195,7 +195,7 @@ export default {
})
},
deleteProfile () {
this.$http.delete('https://localhost:3000/profiles/'.concat(this.selectedProfile.id))
this.$http.delete('/profiles/'.concat(this.selectedProfile.id))
.then(response => {
if (response.status === 200) {
this.populateProfileItems()