Changes
This commit is contained in:
parent
3a3f899ea2
commit
128b3191e7
68 changed files with 28060 additions and 1152 deletions
|
|
@ -7,13 +7,14 @@ export interface AuthUser {
|
|||
verified: boolean;
|
||||
}
|
||||
|
||||
// PocketBase RecordModel stores user fields as dynamic properties
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function recordToUser(record: any): AuthUser {
|
||||
function recordToUser(record: { id: string; [key: string]: unknown }): AuthUser {
|
||||
if (typeof record.email !== 'string') {
|
||||
throw new Error('PocketBase record missing email field');
|
||||
}
|
||||
return {
|
||||
id: record.id || '',
|
||||
email: record.email || '',
|
||||
verified: record.verified || false,
|
||||
id: record.id,
|
||||
email: record.email,
|
||||
verified: typeof record.verified === 'boolean' ? record.verified : false,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue