diff --git a/src/stores/api/account.js b/src/stores/api/account.js index 134b4840..d0dd5a7b 100644 --- a/src/stores/api/account.js +++ b/src/stores/api/account.js @@ -57,6 +57,16 @@ export async function APIUpdatePassword( } } +export async function APIRegisterUser(newProfile) { + try { + const data = await mainStore.callApi(`/user`, "PUT", newProfile); + return data; + } catch (error) { + console.log("Error registering:", error); + throw error; + } +} + export async function APIGetCards() { try { const data = await mainStore.callApi(`/user/card`); diff --git a/src/stores/main.js b/src/stores/main.js index 897c10af..832aec7f 100644 --- a/src/stores/main.js +++ b/src/stores/main.js @@ -97,6 +97,9 @@ export const useMainStore = defineStore("main", { } else if (method === "POST") { this.isLoading = true; this.isSaving = true; + } else if (method === "PUT") { + this.isLoading = true; + this.isSaving = true; } }, 200); // Wait for .2 seconds before showing loading modal }; diff --git a/src/views/Auth/RegisterView.vue b/src/views/Auth/RegisterView.vue index 668c2ffe..21c39bb6 100644 --- a/src/views/Auth/RegisterView.vue +++ b/src/views/Auth/RegisterView.vue @@ -1,76 +1,65 @@