Finish delete endpoint
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user