aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-12 17:26:40 +0200
committerChocobozzz <me@florianbigard.com>2018-10-16 16:41:36 +0200
commitaf5767ffae41b2d5604e41ba9a7225c623dd6735 (patch)
treeb96787bd134fe04d3d042795636df4bf17b5991f /server/lib
parent7ad9b9846c44d198a736183fb186c2039f5236b5 (diff)
downloadPeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.gz
PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.tar.zst
PeerTube-af5767ffae41b2d5604e41ba9a7225c623dd6735.zip
Add user/instance block by users in the client
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/blocklist.ts4
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
5function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { 5function 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
14function addServerInBlocklist (byAccountId: number, targetServerId: number) { 14function 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 })