user login

This commit is contained in:
2026-07-22 17:42:09 +05:30
parent 58c42d9013
commit d196d56929
5 changed files with 16 additions and 11 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"css.lint.unknownAtRules": "ignore"
}

View File

@@ -1,3 +1,4 @@
go 1.21
go 1.24
use ..\fiesta-backend\backend_fiesta

View File

@@ -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() {
)}
<StoreDetailView
store={activeStore}
onBack={selectedStore ? () => setSelectedStore(null) : undefined}
onBack={() => setSelectedStore(null)}
tenantId={tenantId}
/>
</div>

View File

@@ -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: '',

View File

@@ -100,7 +100,7 @@ export default function Header({
{/* Dynamic Store Name Context */}
{storeContext && (
<div className="flex flex-col ml-0.5 sm:ml-1 border-l border-white/20 pl-2 sm:pl-3 py-0.5 select-none min-w-0">
<div className="flex flex-col ml-0.5 sm:ml-1 pl-2 sm:pl-3 py-0.5 select-none min-w-0">
<span className="flex items-center gap-1.5 sm:gap-2 text-xs sm:text-base md:text-lg font-bold tracking-tight text-white leading-tight truncate max-w-[110px] xs:max-w-[150px] sm:max-w-none">
{storeContext.icon && <storeContext.icon size={16} className="text-purple-300 shrink-0 hidden xs:inline" />}
<span className="truncate">{storeContext.storeName}</span>