Finish delete endpoint

This commit is contained in:
2026-01-19 15:14:16 -07:00
parent 0b579800d5
commit d3e6c3863b
2 changed files with 7 additions and 6 deletions

View File

@@ -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
)

View File

@@ -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)
}