From 612fa9228ec8376c1e9d51b63f38647f863c0a06 Mon Sep 17 00:00:00 2001 From: dusk Date: Mon, 16 Dec 2024 20:01:42 +0300 Subject: [PATCH] fix: throw error if parent is not found, not if it is also found --- src/routes/log/create/+server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/log/create/+server.ts b/src/routes/log/create/+server.ts index 6c9fa06..03a4e3f 100644 --- a/src/routes/log/create/+server.ts +++ b/src/routes/log/create/+server.ts @@ -52,8 +52,9 @@ export const POST = async ({ request }) => { if (parentUri !== undefined) { const parentPost = await bot.getPost(parentUri) postRef = await parentPost.reply(postPayload) + } else { + throw "a reply was requested but no reply is found" } - throw "a reply was requested but no reply is found" } else { postRef = await bot.post(postPayload) }