diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-12 17:26:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-16 16:41:36 +0200 |
commit | af5767ffae41b2d5604e41ba9a7225c623dd6735 (patch) | |
tree | b96787bd134fe04d3d042795636df4bf17b5991f /server/models | |
parent | 7ad9b9846c44d198a736183fb186c2039f5236b5 (diff) | |
download | PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.gz PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.zst PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.zip |
Add user/instance block by users in the client
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/account-blocklist.ts | 8 | ||||
-rw-r--r-- | server/models/server/server-blocklist.ts | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index bacd122e8..fa2819235 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts | |||
@@ -18,7 +18,7 @@ enum ScopeNames { | |||
18 | { | 18 | { |
19 | model: () => AccountModel, | 19 | model: () => AccountModel, |
20 | required: true, | 20 | required: true, |
21 | as: 'AccountBlocked' | 21 | as: 'BlockedAccount' |
22 | } | 22 | } |
23 | ] | 23 | ] |
24 | } | 24 | } |
@@ -67,10 +67,10 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | |||
67 | name: 'targetAccountId', | 67 | name: 'targetAccountId', |
68 | allowNull: false | 68 | allowNull: false |
69 | }, | 69 | }, |
70 | as: 'AccountBlocked', | 70 | as: 'BlockedAccount', |
71 | onDelete: 'CASCADE' | 71 | onDelete: 'CASCADE' |
72 | }) | 72 | }) |
73 | AccountBlocked: AccountModel | 73 | BlockedAccount: AccountModel |
74 | 74 | ||
75 | static loadByAccountAndTarget (accountId: number, targetAccountId: number) { | 75 | static loadByAccountAndTarget (accountId: number, targetAccountId: number) { |
76 | const query = { | 76 | const query = { |
@@ -104,7 +104,7 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | |||
104 | toFormattedJSON (): AccountBlock { | 104 | toFormattedJSON (): AccountBlock { |
105 | return { | 105 | return { |
106 | byAccount: this.ByAccount.toFormattedJSON(), | 106 | byAccount: this.ByAccount.toFormattedJSON(), |
107 | accountBlocked: this.AccountBlocked.toFormattedJSON(), | 107 | blockedAccount: this.BlockedAccount.toFormattedJSON(), |
108 | createdAt: this.createdAt | 108 | createdAt: this.createdAt |
109 | } | 109 | } |
110 | } | 110 | } |
diff --git a/server/models/server/server-blocklist.ts b/server/models/server/server-blocklist.ts index 705ed2c6b..450f27152 100644 --- a/server/models/server/server-blocklist.ts +++ b/server/models/server/server-blocklist.ts | |||
@@ -72,7 +72,7 @@ export class ServerBlocklistModel extends Model<ServerBlocklistModel> { | |||
72 | }, | 72 | }, |
73 | onDelete: 'CASCADE' | 73 | onDelete: 'CASCADE' |
74 | }) | 74 | }) |
75 | ServerBlocked: ServerModel | 75 | BlockedServer: ServerModel |
76 | 76 | ||
77 | static loadByAccountAndHost (accountId: number, host: string) { | 77 | static loadByAccountAndHost (accountId: number, host: string) { |
78 | const query = { | 78 | const query = { |
@@ -114,7 +114,7 @@ export class ServerBlocklistModel extends Model<ServerBlocklistModel> { | |||
114 | toFormattedJSON (): ServerBlock { | 114 | toFormattedJSON (): ServerBlock { |
115 | return { | 115 | return { |
116 | byAccount: this.ByAccount.toFormattedJSON(), | 116 | byAccount: this.ByAccount.toFormattedJSON(), |
117 | serverBlocked: this.ServerBlocked.toFormattedJSON(), | 117 | blockedServer: this.BlockedServer.toFormattedJSON(), |
118 | createdAt: this.createdAt | 118 | createdAt: this.createdAt |
119 | } | 119 | } |
120 | } | 120 | } |