Had to be put

This commit is contained in:
Niki Wix Skaarup 2025-04-06 03:15:13 +02:00
parent 170a019bca
commit a25323b0ee
Signed by: nikiskaarup
GPG key ID: FC2F1B116F6E788C

View file

@ -28,13 +28,13 @@ Bun.serve({
async GET(req) {
if (!isAuthenticated(req)) return unauthorizedResp();
const entries = await drizzleDB.select({ id: entry.id, name: entry.name, finished: entry.finished, updated_at: entry.updatedAt}).from(entry).orderBy(desc(entry.updatedAt));
const entries = await drizzleDB.select({ id: entry.id, name: entry.name, finished: entry.finished, updated_at: entry.updatedAt }).from(entry).orderBy(desc(entry.updatedAt));
return new Response(JSON.stringify(entries), {
headers: { 'Content-Type': 'application/json' }
});
},
async POST(req) {
async PUT(req) {
if (!isAuthenticated(req)) return unauthorizedResp();
const body = await getEntryFromReq(req);
@ -121,7 +121,8 @@ Bun.serve({
reusePort: true,
port: env.PORT || 3000,
// async fetch(req, server) {
// return new Response("Not found", { status: 404 });
// console.log(req);
// return new Response("Not found", { status: 404 });
// },
});