reverted back to date for schema
This commit is contained in:
@@ -10,13 +10,14 @@ export async function POST({ request }: APIContext) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const entry: typeof entryTable.$inferInsert = body
|
||||
entry.date = new Date(body.date)
|
||||
|
||||
await db.insert(entryTable).values(entry)
|
||||
|
||||
return httpResponse({ "success": entry }, 200);
|
||||
} catch(e) {
|
||||
return httpResponse({ "error": `Malformed JSON (${e})` }, 400)
|
||||
}
|
||||
|
||||
return httpResponse(null, 200);
|
||||
}
|
||||
|
||||
return httpResponse(null, 400);
|
||||
|
||||
Reference in New Issue
Block a user