File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
2730export 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
6954export async function getUserProfile ( uid : string ) : Promise < UserProfile | null > {
7055 try {
You can’t perform that action at this time.
0 commit comments