From 0d2159c25bc86185fcb7e5de42673167f0a2c37c Mon Sep 17 00:00:00 2001 From: Trenton Zimmer <66042448+trmazi@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:43:49 -0400 Subject: [PATCH] Account registration complete! --- src/stores/api/account.js | 10 ++ src/stores/main.js | 3 + src/views/Auth/RegisterView.vue | 269 +++++++++++++++++--------------- src/views/Profile/CardsView.vue | 4 +- 4 files changed, 156 insertions(+), 130 deletions(-) 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 @@