Skip to content

Commit

Permalink
Merge pull request #104 from TogetherCrew/103-add-twitter-related-fie…
Browse files Browse the repository at this point in the history
…lds-to-user-schema

103 add twitter related fields to user schema
  • Loading branch information
cyri113 authored Sep 14, 2023
2 parents 9638113 + a3a07e7 commit 65ed51f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ User {
flags?: number,
premium_type?: number,
public_flags?: number,
twitterId?: string,
twitterUsername?: string,
twitterProfileImageUrl?: string,

}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@togethercrew.dev/db",
"version": "2.4.96",
"version": "2.4.97",
"description": "All interactions with DB",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/interfaces/User.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ export interface IUser {
flags?: number;
premium_type?: number;
public_flags?: number;
twitterId?: string | null;
twitterUsername?: string | null;
twitterProfileImageUrl?: string | null;
}

export interface IUserUpdateBody {
avatar?: string;
twitterId?: string | null;
twitterUsername?: string | null;
twitterProfileImageUrl?: string | null;
email?: string;
verified?: boolean;
}
Expand Down
11 changes: 11 additions & 0 deletions src/models/schemas/User.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ const userSchema = new Schema<IUser, UserModel>(
avatar: {
type: String,
},
twitterId: {
type: String,
},

twitterUsername: {
type: String,
},

twitterProfileImageUrl: {
type: String,
},
},
{ timestamps: true },
);
Expand Down

0 comments on commit 65ed51f

Please sign in to comment.