From d3e6c3863bc78c73c3593c0506970b3b3e999e11 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Mon, 19 Jan 2026 15:14:16 -0700 Subject: [PATCH] Finish delete endpoint --- src/index.ts | 4 +++- src/routes/berrydash/profile/posts/delete.ts | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7f3c631..0066095 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,7 +52,9 @@ app.delete('/berrydash/profile/posts', context => app.all('*', () => jsonResponse( { - message: 'No endpoint found (are you using the correct request method?)' + success: false, + message: 'No endpoint found (are you using the correct request method?)', + data: null }, 404 ) diff --git a/src/routes/berrydash/profile/posts/delete.ts b/src/routes/berrydash/profile/posts/delete.ts index 54420fe..56ef195 100644 --- a/src/routes/berrydash/profile/posts/delete.ts +++ b/src/routes/berrydash/profile/posts/delete.ts @@ -43,9 +43,9 @@ export async function handler (context: Context) { } const userData = await db1 - .select({ id: users.id }) + .select({ id: berryDashUserData.id }) .from(berryDashUserData) - .where(eq(berryDashUserData.token, authorizationToken as string)) + .where(eq(berryDashUserData.token, authorizationToken)) .execute() if (!userData[0]) { @@ -73,7 +73,6 @@ export async function handler (context: Context) { connection1.end() if (result[0]) - return jsonResponse({ success: true, message: 'Success', data: null }, 200) - else - return jsonResponse({ success: false, message: 'Failed', data: null }, 400) + return jsonResponse({ success: true, message: null, data: null }, 200) + else return jsonResponse({ success: false, message: null, data: null }, 400) }