From cbce9874538f55b88c12fa9b65c7b1a2713631ae 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 422da8884..33a5ef7f9 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);