aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
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 })