Skip to content

Commit 8dd527b

Browse files
committed
chore: profile update extended
1 parent d7e9226 commit 8dd527b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/models/Account.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default interface Account {
44
password: string
55
name: string
66
about?: string
7-
gender?: 'male' | 'female' | 'other' | 'prefer_not_to_say'
8-
birthday?: Date
9-
profileImageUrl?: string
7+
gender?: 'Männlich' | 'Weiblich' | 'Divers' | 'Keine Angabe'
8+
birthday?: Date | undefined
9+
profileImages?: string[]
1010
}

src/services/account.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type Account from '@/models/Account'
22
import airtableBase from './airtable.service'
33
import { sha256 } from 'js-sha256'
4+
import type { RecordData } from 'airtable'
45

56
const TABLE_NAME = 'Account'
67
const ACTIVE_VIEW = 'Grid view'
@@ -64,9 +65,9 @@ class AccountService {
6465
'E-Mail': account.email,
6566
'Password': hashedPassword, // Store hashed password
6667
'About': account.about || '',
67-
'Gender': account.gender || '',
68+
'Gender': account.gender || undefined,
6869
'Birthday': account.birthday && account.birthday instanceof Date ? account.birthday.toISOString().split('T')[0] : null,
69-
'Profile Image': account.profileImageUrl || '',
70+
'Bilder': undefined, // No profile images yet
7071
}
7172
}
7273
],
@@ -87,7 +88,7 @@ class AccountService {
8788
about: createdRecord.get('About') as string,
8889
gender: createdRecord.get('Gender') as Account['gender'],
8990
birthday: createdRecord.get('Birthday') ? new Date(createdRecord.get('Birthday') as string) : undefined,
90-
profileImageUrl: createdRecord.get('ProfileImageUrl') as string,
91+
profileImages: createdRecord.get('Bilder') as string[],
9192
}
9293
resolve(createdAccount)
9394
} else {
@@ -119,7 +120,7 @@ class AccountService {
119120
'About': account.about || '',
120121
'Gender': account.gender || '',
121122
'Birthday': account.birthday ? account.birthday.toISOString().split('T')[0] : '',
122-
'Profile Image': account.profileImageUrl || '',
123+
'Bilder': account.profileImages || '',
123124
}
124125
}
125126
],

0 commit comments

Comments
 (0)