From 5445a3d1c041d7a29e9fdd194290b5b30843e7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Mon, 16 Jun 2025 00:14:36 +0800 Subject: [PATCH] Add a little success pop up. --- components/app/windows/settings.vue | 17 +++++++++++++++++ server/api/user/sendUserChanges.post.ts | 1 + 2 files changed, 18 insertions(+) diff --git a/components/app/windows/settings.vue b/components/app/windows/settings.vue index 4f741e8..0e3c6bb 100644 --- a/components/app/windows/settings.vue +++ b/components/app/windows/settings.vue @@ -18,6 +18,7 @@ const user = ref(""); const enterFirstName = ref(); const isLoggedIn = ref(false); const useremail = ref(); +const sendSuccess = ref(false); const userData = ref({ userAccount: "", firstName: "", @@ -83,11 +84,19 @@ const submitCustomApiKey = async () => { if (response.error) { console.error("Error updating user data:", response.error); } + sendSuccessSystem(); } catch (error) { console.error("Failed to submit change:", error); } }; +const sendSuccessSystem = () => { + sendSuccess.value = true; + setTimeout(() => { + sendSuccess.value = false; + }, 3000); +}; + const checkValidApiKey = () => { const apiKey = customApiKey.value; if (!apiKey) { @@ -110,6 +119,7 @@ const deleteAccount = async () => { method: "DELETE", }); const res = await req.json(); + sendSuccessSystem(); console.log(res); }; @@ -218,6 +228,13 @@ const submitUserPassword = async () => { {{ t("settings.loginButton") }} +
+ + Success! +

{{ t("settings.greet") diff --git a/server/api/user/sendUserChanges.post.ts b/server/api/user/sendUserChanges.post.ts index 6bbf0da..f50fcbd 100644 --- a/server/api/user/sendUserChanges.post.ts +++ b/server/api/user/sendUserChanges.post.ts @@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => { // Use Static values for now. const requestChange = body.action || ""; const apiKeyqq = body.value.match(clearBadDataRegex); + console.log(apiKeyqq); const allowedColumns = ["firstname", "email"]; if (!allowedColumns.includes(requestChange)) {