Skip to content

Commit faa6c97

Browse files
authored
Update userService.ts
1 parent b834a74 commit faa6c97

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

lib/userService.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ export interface UserProfile {
1414
uid: string;
1515
createdAt?: string;
1616
updatedAt?: string;
17+
18+
// Social Media
1719
github?: string;
1820
linkedin?: string;
1921
instagram?: string;
2022
reddit?: string;
2123
discord?: string;
24+
2225
// Streak
2326
streak?: number;
2427
lastLoginDate?: string;
2528
}
2629

2730
export async function createUserProfile(
2831
uid: string,
29-
userData: Omit<UserProfile, 'uid' | 'createdAt' | 'updatedAt'>
32+
userData: Omit<UserProfile, 'uid' | 'createdAt' | 'updatedAt' | 'streak' | 'lastLoginDate'>
3033
) {
3134
try {
3235
await setDoc(doc(db, 'users', uid), {
@@ -47,24 +50,6 @@ export async function createUserProfile(
4750
throw error;
4851
}
4952
}
50-
}
51-
52-
export async function createUserProfile(
53-
uid: string,
54-
userData: Omit<UserProfile, 'uid' | 'createdAt' | 'updatedAt'>
55-
) {
56-
try {
57-
await setDoc(doc(db, 'users', uid), {
58-
...userData,
59-
uid,
60-
createdAt: new Date().toISOString(),
61-
updatedAt: new Date().toISOString(),
62-
});
63-
} catch (error) {
64-
console.error('Error creating profile:', error);
65-
throw error;
66-
}
67-
}
6853

6954
export async function getUserProfile(uid: string): Promise<UserProfile | null> {
7055
try {

0 commit comments

Comments
 (0)