From f25777f2d2839b2373933644fd527af8028ff415 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 3 Jan 2022 03:17:16 +0900 Subject: [PATCH] refactor(server): use insert instead of save --- packages/backend/src/services/relay.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index 422da88846..33a5ef7f9b 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -22,11 +22,11 @@ export async function getRelayActor(): Promise { } export async function addRelay(inbox: string) { - const relay = await Relays.save({ + const relay = await Relays.insert({ id: genId(), inbox, status: 'requesting', - }); + }).then(x => Relays.findOneOrFail(x.identifiers[0])); const relayActor = await getRelayActor(); const follow = await renderFollowRelay(relay, relayActor);