website refactor
This commit is contained in:
@@ -39,7 +39,7 @@ export class SeedDemoUsers {
|
||||
email: 'demo.sponsor@example.com',
|
||||
password: 'Demo1234!',
|
||||
needsAdminUser: false,
|
||||
needsPrimaryDriverId: false,
|
||||
needsPrimaryDriverId: true,
|
||||
roles: ['sponsor'],
|
||||
displayName: 'Jane Sponsor',
|
||||
},
|
||||
@@ -113,8 +113,18 @@ export class SeedDemoUsers {
|
||||
}
|
||||
|
||||
private generatePrimaryDriverId(email: string, persistence: 'postgres' | 'inmemory'): string {
|
||||
// Use the email as the seed for the primary driver ID
|
||||
const seedKey = `primary-driver-${email}`;
|
||||
// Use predefined IDs for demo users to match SeedRacingData
|
||||
const demoDriverIds: Record<string, string> = {
|
||||
'demo.driver@example.com': 'driver-1',
|
||||
'demo.sponsor@example.com': 'driver-2',
|
||||
'demo.owner@example.com': 'driver-3',
|
||||
'demo.steward@example.com': 'driver-4',
|
||||
'demo.admin@example.com': 'driver-5',
|
||||
'demo.systemowner@example.com': 'driver-6',
|
||||
'demo.superadmin@example.com': 'driver-7',
|
||||
};
|
||||
|
||||
const seedKey = demoDriverIds[email] || `primary-driver-${email}`;
|
||||
return this.generateDeterministicId(seedKey, persistence);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user