diff options
Diffstat (limited to 'server/models/user')
-rw-r--r-- | server/models/user/user-interface.ts | 6 | ||||
-rw-r--r-- | server/models/user/user.ts | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/server/models/user/user-interface.ts b/server/models/user/user-interface.ts index 1ba4bd800..6726e8ab5 100644 --- a/server/models/user/user-interface.ts +++ b/server/models/user/user-interface.ts | |||
@@ -6,10 +6,10 @@ import { User as FormatedUser } from '../../../shared/models/user.model' | |||
6 | 6 | ||
7 | export namespace UserMethods { | 7 | export namespace UserMethods { |
8 | export type IsPasswordMatchCallback = (err: Error, same: boolean) => void | 8 | export type IsPasswordMatchCallback = (err: Error, same: boolean) => void |
9 | export type IsPasswordMatch = (password: string, callback: IsPasswordMatchCallback) => void | 9 | export type IsPasswordMatch = (this: UserInstance, password: string, callback: IsPasswordMatchCallback) => void |
10 | 10 | ||
11 | export type ToFormatedJSON = () => FormatedUser | 11 | export type ToFormatedJSON = (this: UserInstance) => FormatedUser |
12 | export type IsAdmin = () => boolean | 12 | export type IsAdmin = (this: UserInstance) => boolean |
13 | 13 | ||
14 | export type CountTotalCallback = (err: Error, total: number) => void | 14 | export type CountTotalCallback = (err: Error, total: number) => void |
15 | export type CountTotal = (callback: CountTotalCallback) => void | 15 | export type CountTotal = (callback: CountTotalCallback) => void |
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index d78f5f845..6b2410259 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -131,7 +131,7 @@ function beforeCreateOrUpdate (user: UserInstance) { | |||
131 | 131 | ||
132 | // ------------------------------ METHODS ------------------------------ | 132 | // ------------------------------ METHODS ------------------------------ |
133 | 133 | ||
134 | isPasswordMatch = function (password: string, callback: UserMethods.IsPasswordMatchCallback) { | 134 | isPasswordMatch = function (this: UserInstance, password: string, callback: UserMethods.IsPasswordMatchCallback) { |
135 | return comparePassword(password, this.password, callback) | 135 | return comparePassword(password, this.password, callback) |
136 | } | 136 | } |
137 | 137 | ||
@@ -146,7 +146,7 @@ toFormatedJSON = function (this: UserInstance) { | |||
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | isAdmin = function () { | 149 | isAdmin = function (this: UserInstance) { |
150 | return this.role === USER_ROLES.ADMIN | 150 | return this.role === USER_ROLES.ADMIN |
151 | } | 151 | } |
152 | 152 | ||