1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 15:30:05 +00:00

chore: code refactor

This commit is contained in:
Saad Jutt
2022-07-03 07:03:15 +05:00
parent 9c3da56901
commit eee3a7b084
3 changed files with 35 additions and 31 deletions

View File

@@ -35,6 +35,7 @@ export interface UserPayload {
}
interface IUserDocument extends UserPayload, Document {
_id: Schema.Types.ObjectId
id: number
isAdmin: boolean
isActive: boolean
@@ -43,7 +44,7 @@ interface IUserDocument extends UserPayload, Document {
tokens: [{ [key: string]: string }]
}
interface IUser extends IUserDocument {
export interface IUser extends IUserDocument {
comparePassword(password: string): boolean
addGroup(groupObjectId: Schema.Types.ObjectId): Promise<IUser>
removeGroup(groupObjectId: Schema.Types.ObjectId): Promise<IUser>