Update to use v2

This commit is contained in:
Troplo 2021-04-09 23:26:41 +10:00
parent 5ded3b16f0
commit 9ec7e1c65f
5 changed files with 14 additions and 8 deletions

2
.env
View File

@ -1,5 +1,5 @@
VUE_APP_APIENDPOINT=/api/
VUE_APP_APIVERSION=v1
VUE_APP_APIVERSION=v2
VUE_APP_GATEWAYENDPOINT=/socket.io/
VUE_APP_STAGING=true
VUE_APP_I18N_LOCALE=en

View File

@ -1,5 +1,5 @@
VUE_APP_APIENDPOINT="/api/"
VUE_APP_APIVERSION="v1"
VUE_APP_APIVERSION="v2"
VUE_APP_GATEWAYENDPOINT="/socket.io/"
VUE_APP_STAGING=true
VUE_APP_RELEASE="Canary"

View File

@ -475,7 +475,8 @@ export default {
doRegister() {
this.register.loading = true;
this.axios
.post("/api/v1/passkey/register", {
.post(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + "/passkey/register", {
username: this.register.username,
password: this.register.password,
email: this.register.email,
@ -510,7 +511,8 @@ export default {
doLogin() {
this.login.loading = true;
this.axios
.post("/api/v1/users/login", {
.post(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + "/users/login", {
username: this.login.username,
password: this.login.password,
})

View File

@ -53,7 +53,8 @@ export default {
},
authTest() {
this.axios
.get("/api/v1/userinfo/auth")
.get(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + "/userinfo/auth")
.then(() => {
this.$buefy.snackbar.open({
message: this.$t("errors.authSuccess"),

View File

@ -185,7 +185,8 @@ export default {
},
doInit() {
this.register.init.loading = true
this.axios.post('/api/v1/passkey/register', {
this.axios.post(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + '/passkey/register', {
username: this.register.init.username,
password: this.register.init.password,
email: this.register.init.email,
@ -206,7 +207,8 @@ export default {
},
doInfo() {
this.register.personal.loading = true
this.axios.put('/api/v1/users/preferences', {
this.axios.put(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + '/users/preferences', {
description: this.register.personal.description
}).then(() => {
this.getInfo()
@ -220,7 +222,8 @@ export default {
},
doTheme(theme) {
this.register.customization.loading = true
this.axios.put('/api/v1/users/preferences', {
this.axios.put(process.env.VUE_APP_APIENDPOINT +
process.env.VUE_APP_APIVERSION + '/users/preferences', {
theme: theme
}).then(() => {
this.getInfo()