small changes
This commit is contained in:
4938
backend/database/package-lock.json
generated
Normal file
4938
backend/database/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -222,6 +222,13 @@ export default {
|
||||
|
||||
const res = await db.insert(user).values({ id, name, email }).returning().get();
|
||||
return json({ res });
|
||||
} else if (method === "DELETE") {
|
||||
const params = url.searchParams;
|
||||
if (params.has("id")) {
|
||||
const id = params.get("id") as string;
|
||||
await db.delete(user).where(eq(user.id, id));
|
||||
return success;
|
||||
} else return invalidRequest;
|
||||
} else {
|
||||
return methodNotAllowed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user