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/lib/blocklist.ts | |
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/lib/blocklist.ts')
-rw-r--r-- | server/lib/blocklist.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/blocklist.ts b/server/lib/blocklist.ts index 394c24537..1633e500c 100644 --- a/server/lib/blocklist.ts +++ b/server/lib/blocklist.ts | |||
@@ -4,7 +4,7 @@ import { ServerBlocklistModel } from '../models/server/server-blocklist' | |||
4 | 4 | ||
5 | function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { | 5 | function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { |
6 | return sequelizeTypescript.transaction(async t => { | 6 | return sequelizeTypescript.transaction(async t => { |
7 | return AccountBlocklistModel.create({ | 7 | return AccountBlocklistModel.upsert({ |
8 | accountId: byAccountId, | 8 | accountId: byAccountId, |
9 | targetAccountId: targetAccountId | 9 | targetAccountId: targetAccountId |
10 | }, { transaction: t }) | 10 | }, { transaction: t }) |
@@ -13,7 +13,7 @@ function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { | |||
13 | 13 | ||
14 | function addServerInBlocklist (byAccountId: number, targetServerId: number) { | 14 | function addServerInBlocklist (byAccountId: number, targetServerId: number) { |
15 | return sequelizeTypescript.transaction(async t => { | 15 | return sequelizeTypescript.transaction(async t => { |
16 | return ServerBlocklistModel.create({ | 16 | return ServerBlocklistModel.upsert({ |
17 | accountId: byAccountId, | 17 | accountId: byAccountId, |
18 | targetServerId | 18 | targetServerId |
19 | }, { transaction: t }) | 19 | }, { transaction: t }) |