Skip to content

Commit a8e0f51

Browse files
authored
Merge pull request #105 from TogetherCrew/103-add-twitter-related-fields-to-user-schema
[FEATURE]: add twitterConnectedAt field
2 parents 65ed51f + d3324a6 commit a8e0f51

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ User {
7474
twitterId?: string,
7575
twitterUsername?: string,
7676
twitterProfileImageUrl?: string,
77+
twitterConnectedAt?:string,
7778

7879
}
7980
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@togethercrew.dev/db",
3-
"version": "2.4.97",
3+
"version": "2.4.98",
44
"description": "All interactions with DB",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/config/tokens.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ export const tokenTypes = {
33
REFRESH: 'refresh',
44
DISCORD_ACCESS: 'discord_access',
55
DISCORD_REFRESH: 'discord_refresh',
6+
TWITTER_ACCESS: 'twitter_access',
7+
TWITTER_REFRESH: 'twitter_refresh',
68
};

src/interfaces/User.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ export interface IUser {
2020
twitterId?: string | null;
2121
twitterUsername?: string | null;
2222
twitterProfileImageUrl?: string | null;
23+
twitterConnectedAt?: Date | null;
2324
}
2425

2526
export interface IUserUpdateBody {
2627
avatar?: string;
2728
twitterId?: string | null;
2829
twitterUsername?: string | null;
2930
twitterProfileImageUrl?: string | null;
31+
twitterConnectedAt?: Date | null;
3032
email?: string;
3133
verified?: boolean;
3234
}

src/models/schemas/User.schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const userSchema = new Schema<IUser, UserModel>(
3636
twitterProfileImageUrl: {
3737
type: String,
3838
},
39+
twitterConnectedAt: {
40+
type: Date,
41+
default: null,
42+
},
3943
},
4044
{ timestamps: true },
4145
);

0 commit comments

Comments
 (0)