From 3f96a8203de222c1eb6ebd226906168e3b63077c Mon Sep 17 00:00:00 2001 From: Atul Gunjal Date: Thu, 8 May 2025 13:04:43 +0530 Subject: [PATCH] recovered collection, removed "alert" & "back to dashboard" --- .env.local | 4 ++-- src/app/lib/config.js | 2 +- src/app/pages/MultiBooked/page.js | 2 +- src/app/pages/ResetPasswordPage/page.js | 23 ++++++++++++++++++++--- src/app/pages/SignInPage/page.js | 4 ++-- src/app/pages/SignUpPage/page.js | 4 ++-- src/app/signup/page.js | 4 ++-- 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.env.local b/.env.local index a1e6527..49d7333 100644 --- a/.env.local +++ b/.env.local @@ -1,5 +1,5 @@ NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1 NEXT_PUBLIC_APPWRITE_PROJECT_ID=67e1445400053dca1d9b NEXT_PUBLIC_APPWRITE_DATABASE_ID=67e1452b00016444b37f -NEXT_PUBLIC_APPWRITE_COLLECTION_ID=67fe4029000f7e0a7b92 -NEXT_PUBLIC_APPWRITE_USERS_COLLECTION_ID=67ff72bd00370366ae3e +NEXT_PUBLIC_APPWRITE_COLLECTION_ID=681c367b0016f9ba0e8e +NEXT_PUBLIC_APPWRITE_USERS_COLLECTION_ID=681c35690038f9798152 diff --git a/src/app/lib/config.js b/src/app/lib/config.js index 68ac91d..7f4fb0e 100644 --- a/src/app/lib/config.js +++ b/src/app/lib/config.js @@ -6,6 +6,6 @@ // lib/config.js export const DATABASE_ID = "67e1452b00016444b37f"; -export const COLLECTION_ID = "67fe4029000f7e0a7b92"; +export const COLLECTION_ID = "681c367b0016f9ba0e8e"; export const SETTINGS_COLLECTION_ID = "settings"; export const AVG_CONSULTATION_KEY = "avg_consultation"; \ No newline at end of file diff --git a/src/app/pages/MultiBooked/page.js b/src/app/pages/MultiBooked/page.js index d8c4b82..16606b0 100644 --- a/src/app/pages/MultiBooked/page.js +++ b/src/app/pages/MultiBooked/page.js @@ -82,7 +82,7 @@ const createEntries = async () => { } setBookings(updatedBookings); - alert(`${validBookings.length} tokens created successfully!`); + // alert(`${validBookings.length} tokens created successfully!`); } catch (error) { console.error("Creation error:", error); setError(error.message); diff --git a/src/app/pages/ResetPasswordPage/page.js b/src/app/pages/ResetPasswordPage/page.js index b34d281..a310d65 100644 --- a/src/app/pages/ResetPasswordPage/page.js +++ b/src/app/pages/ResetPasswordPage/page.js @@ -17,16 +17,24 @@ export default function ResetPasswordPage() { const { darkMode, toggleDarkMode } = useTheme(); const [email, setEmail] = useState(""); const [loading, setLoading] = useState(false); + const [message, setMessage] = useState({ text: "", type: "" }); // type can be "success" or "error" const handleSubmit = async (e) => { e.preventDefault(); setLoading(true); + setMessage({ text: "", type: "" }); try { await account.createRecovery(email, "http://localhost:3000/reset-password"); - alert("Password reset link sent to your email!"); + setMessage({ + text: "Password reset link sent to your email!", + type: "success" + }); } catch (error) { console.error("Error:", error); - alert(`Failed to send reset link: ${error.message}`); + setMessage({ + text: `Failed to send reset link: ${error.message}`, + type: "error" + }); } finally { setLoading(false); } @@ -53,6 +61,15 @@ export default function ResetPasswordPage() {

Enter your email address linked to your account, and we'll send you a link to reset your password.

+ {message.text && ( +
+ {message.text} +
+ )}
@@ -85,4 +102,4 @@ export default function ResetPasswordPage() {
); -} +} \ No newline at end of file diff --git a/src/app/pages/SignInPage/page.js b/src/app/pages/SignInPage/page.js index 66832a3..ff428d8 100644 --- a/src/app/pages/SignInPage/page.js +++ b/src/app/pages/SignInPage/page.js @@ -87,7 +87,7 @@ export default function SignInPage() { {/* Left Side - Form */}
- @@ -108,7 +108,7 @@ export default function SignInPage() { /> Back to dashboard - + */}

diff --git a/src/app/pages/SignUpPage/page.js b/src/app/pages/SignUpPage/page.js index 66d55cf..c14af34 100644 --- a/src/app/pages/SignUpPage/page.js +++ b/src/app/pages/SignUpPage/page.js @@ -86,7 +86,7 @@ export default function SignUpPage() { {/* Form */}
- @@ -107,7 +107,7 @@ export default function SignUpPage() { /> Back to dashboard - + */}
diff --git a/src/app/signup/page.js b/src/app/signup/page.js index 0a4b9bf..8f3ff34 100644 --- a/src/app/signup/page.js +++ b/src/app/signup/page.js @@ -107,7 +107,7 @@ export default function SignUpPage() { {/* Left side - Form */}
-
+ {/*
Back to dashboard -
+
*/}