This commit is contained in:
Akis 2023-01-08 21:46:17 +02:00
parent a24fc12345
commit 61237981fe
Signed by untrusted user: akis
GPG Key ID: 267BF5C6677944ED

View File

@ -2,6 +2,7 @@ import type { Actions } from "./$types";
import Joi from "joi";
import { fail } from "@sveltejs/kit";
import { db } from "$lib/server/db";
import dayjs from "dayjs";
export const actions: Actions = {
add: async ({ request, locals }) => {
@ -24,8 +25,8 @@ export const actions: Actions = {
const data = {
...Object.fromEntries(formData.entries()),
created: now,
createdAt: now,
updatedAt: now
createdAt: dayjs.unix(now).toISOString(),
updatedAt: dayjs.unix(now).toISOString()
};
await db.delete("*").from("Announcements");