File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ memberactivities {
189189``` ts
190190Token {
191191 token : string ,
192- user : Snowflake ,
192+ user : Types . ObjectId ,
193193 type : string ,
194194 expires : Date ,
195195 blacklisted ?: boolean
Original file line number Diff line number Diff line change 11import { Token } from '../../../src/models' ;
22import { IToken } from '../../../src/interfaces' ;
3+ import { Types } from 'mongoose' ;
34import moment from 'moment' ;
45
56describe ( 'Token model' , ( ) => {
67 describe ( 'Token validation' , ( ) => {
78 let token : IToken ;
89 beforeEach ( ( ) => {
910 token = {
10- user : '1234' ,
11+ user : new Types . ObjectId ( ) ,
1112 token : '4321' ,
1213 type : 'access' ,
1314 expires : moment ( '2022-02-01 08:30:26.127Z' ) . toDate ( ) ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @togethercrew.dev/db" ,
3- "version" : " 3.0.18 " ,
3+ "version" : " 3.0.19 " ,
44 "description" : " All interactions with DB" ,
55 "main" : " ./dist/index.js" ,
66 "types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change 1- import { type Snowflake } from 'discord.js' ;
2- import { type Model } from 'mongoose' ;
1+ import { type Model , type Types } from 'mongoose' ;
32
43export interface IToken {
54 token : string ;
6- user : Snowflake ;
5+ user : Types . ObjectId ;
76 type : string ;
87 expires : Date ;
98 blacklisted ?: boolean ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const tokenSchema = new Schema<IToken>(
1111 index : true ,
1212 } ,
1313 user : {
14- type : String ,
14+ type : Schema . Types . ObjectId ,
1515 ref : 'User' ,
1616 required : true ,
1717 } ,
You can’t perform that action at this time.
0 commit comments