aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 19:05:31 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 19:23:10 +0200
commit1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch)
tree27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/models/account/user.ts
parent0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff)
downloadPeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip
Type toFormattedJSON
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r--server/models/account/user.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index cb54d79af..616dd603c 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -55,7 +55,13 @@ import { UserAdminFlag } from '../../../shared/models/users/user-flag.model'
55import { isThemeNameValid } from '../../helpers/custom-validators/plugins' 55import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
56import { getThemeOrDefault } from '../../lib/plugins/theme-utils' 56import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
57import * as Bluebird from 'bluebird' 57import * as Bluebird from 'bluebird'
58import { MUserNotifSettingChannelDefault, MUserDefault, MUserId, MUserWithNotificationSetting } from '@server/typings/models' 58import {
59 MUserDefault,
60 MUserFormattable,
61 MUserId,
62 MUserNotifSettingChannelDefault,
63 MUserWithNotificationSetting
64} from '@server/typings/models'
59 65
60enum ScopeNames { 66enum ScopeNames {
61 WITH_VIDEO_CHANNEL = 'WITH_VIDEO_CHANNEL' 67 WITH_VIDEO_CHANNEL = 'WITH_VIDEO_CHANNEL'
@@ -554,7 +560,9 @@ export class UserModel extends Model<UserModel> {
554 return comparePassword(password, this.password) 560 return comparePassword(password, this.password)
555 } 561 }
556 562
557 toFormattedJSON (parameters: { withAdminFlags?: boolean } = {}): User { 563 toSummaryJSON
564
565 toFormattedJSON (this: MUserFormattable, parameters: { withAdminFlags?: boolean } = {}): User {
558 const videoQuotaUsed = this.get('videoQuotaUsed') 566 const videoQuotaUsed = this.get('videoQuotaUsed')
559 const videoQuotaUsedDaily = this.get('videoQuotaUsedDaily') 567 const videoQuotaUsedDaily = this.get('videoQuotaUsedDaily')
560 568