Skip to content

Commit

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

[FEATURE]: add twitterConnectedAt field
  • Loading branch information
cyri113 authored Sep 14, 2023
2 parents 65ed51f + d3324a6 commit a8e0f51
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ User {
twitterId?: string,
twitterUsername?: string,
twitterProfileImageUrl?: string,
twitterConnectedAt?: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.97",
"version": "2.4.98",
"description": "All interactions with DB",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ export const tokenTypes = {
REFRESH: 'refresh',
DISCORD_ACCESS: 'discord_access',
DISCORD_REFRESH: 'discord_refresh',
TWITTER_ACCESS: 'twitter_access',
TWITTER_REFRESH: 'twitter_refresh',
};
2 changes: 2 additions & 0 deletions src/interfaces/User.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ export interface IUser {
twitterId?: string | null;
twitterUsername?: string | null;
twitterProfileImageUrl?: string | null;
twitterConnectedAt?: Date | null;
}

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

0 comments on commit a8e0f51

Please sign in to comment.