From 8cbfc047bbc538a20dd01a748dbfb2c7fa5dd5c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 26 Mar 2022 18:42:37 +0900 Subject: [PATCH] refactor --- .../src/remote/activitypub/db-resolver.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/backend/src/remote/activitypub/db-resolver.ts b/packages/backend/src/remote/activitypub/db-resolver.ts index 0827706d9..3d61296bf 100644 --- a/packages/backend/src/remote/activitypub/db-resolver.ts +++ b/packages/backend/src/remote/activitypub/db-resolver.ts @@ -24,15 +24,15 @@ export default class DbResolver { const parsed = this.parseUri(value); if (parsed.id) { - return (await Notes.findOneBy({ + return await Notes.findOneBy({ id: parsed.id, - })) || null; + }); } if (parsed.uri) { - return (await Notes.findOneBy({ + return await Notes.findOneBy({ uri: parsed.uri, - })) || null; + }); } return null; @@ -42,15 +42,15 @@ export default class DbResolver { const parsed = this.parseUri(value); if (parsed.id) { - return (await MessagingMessages.findOneBy({ + return await MessagingMessages.findOneBy({ id: parsed.id, - })) || null; + }); } if (parsed.uri) { - return (await MessagingMessages.findOneBy({ + return await MessagingMessages.findOneBy({ uri: parsed.uri, - })) || null; + }); } return null; @@ -63,15 +63,15 @@ export default class DbResolver { const parsed = this.parseUri(value); if (parsed.id) { - return (await Users.findOneBy({ + return await Users.findOneBy({ id: parsed.id, - })) || null; + }); } if (parsed.uri) { - return (await Users.findOneBy({ + return await Users.findOneBy({ uri: parsed.uri, - })) || null; + }); } return null;