From d196d569298978c5a638352cf2964ae6ec5475e1 Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 22 Jul 2026 17:42:09 +0530 Subject: [PATCH] user login --- .vscode/settings.json | 3 +++ go.work | 3 ++- src/App.tsx | 6 +++--- src/components/AdminConsole.tsx | 13 +++++++------ src/components/Header.tsx | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5a586b3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "css.lint.unknownAtRules": "ignore" +} diff --git a/go.work b/go.work index d4bf84b..da4375c 100644 --- a/go.work +++ b/go.work @@ -1,3 +1,4 @@ -go 1.21 +go 1.24 use ..\fiesta-backend\backend_fiesta + diff --git a/src/App.tsx b/src/App.tsx index 11f809f..ba65e8b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -270,8 +270,8 @@ export default function App() { // Define secondary sections (Stores, Logistics, Staffing, Settings) within main body const renderStoresSection = () => { - const isSoleStore = !selectedStore && storesList.length === 1; - const activeStore = selectedStore ?? (isSoleStore ? storesList[0] : null); + const isSoleStore = storesList.length === 1; + const activeStore = selectedStore; if (activeStore) { return ( @@ -290,7 +290,7 @@ export default function App() { )} setSelectedStore(null) : undefined} + onBack={() => setSelectedStore(null)} tenantId={tenantId} /> diff --git a/src/components/AdminConsole.tsx b/src/components/AdminConsole.tsx index 0e1c4b8..5dcaf53 100644 --- a/src/components/AdminConsole.tsx +++ b/src/components/AdminConsole.tsx @@ -110,7 +110,7 @@ export default function AdminConsole({ activeTab: propActiveTab, showHeader = tr lastname: '', email: '', contactno: '', - password: 'Rider@123', + password: '', locationid: 0, shiftid: 0, vehiclename: '', @@ -192,15 +192,16 @@ export default function AdminConsole({ activeTab: propActiveTab, showHeader = tr return; } try { - // Create base user with roleid = 3 and configid = 6 (Rider config) + // Create base user with roleid = 5 (Rider) and configid = 1, matching the + // convention login (auth.ts) queries against. const res = await createUserMut.mutateAsync({ firstname: riderForm.firstname, lastname: riderForm.lastname, email: riderForm.email, contactno: riderForm.contactno, password: riderForm.password, - roleid: 3, - configid: 6, + roleid: 5, + configid: 1, tenantid: FIESTA_TENANT_ID, locationid: Number(riderForm.locationid), applocationid: 1, @@ -781,7 +782,7 @@ VALUES (${newUserId}, 1, 'Active', NOW()); lastname: '', email: '', contactno: '', - password: 'Rider@123', + password: '', locationid: 0, shiftid: 0, vehiclename: '', @@ -1456,7 +1457,7 @@ VALUES (${newUserId}, 1, 'Active', NOW()); lastname: '', email: '', contactno: '', - password: 'Rider@123', + password: '', locationid: 0, shiftid: 0, vehiclename: '', diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 3547cf4..738dd0a 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -100,7 +100,7 @@ export default function Header({ {/* Dynamic Store Name Context */} {storeContext && ( -
+
{storeContext.icon && } {storeContext.storeName}