forked from ProjectSegfault/website
aaaaa
This commit is contained in:
parent
a24fc12345
commit
61237981fe
@ -2,6 +2,7 @@ import type { Actions } from "./$types";
|
|||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
import { fail } from "@sveltejs/kit";
|
import { fail } from "@sveltejs/kit";
|
||||||
import { db } from "$lib/server/db";
|
import { db } from "$lib/server/db";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
export const actions: Actions = {
|
export const actions: Actions = {
|
||||||
add: async ({ request, locals }) => {
|
add: async ({ request, locals }) => {
|
||||||
@ -24,8 +25,8 @@ export const actions: Actions = {
|
|||||||
const data = {
|
const data = {
|
||||||
...Object.fromEntries(formData.entries()),
|
...Object.fromEntries(formData.entries()),
|
||||||
created: now,
|
created: now,
|
||||||
createdAt: now,
|
createdAt: dayjs.unix(now).toISOString(),
|
||||||
updatedAt: now
|
updatedAt: dayjs.unix(now).toISOString()
|
||||||
};
|
};
|
||||||
|
|
||||||
await db.delete("*").from("Announcements");
|
await db.delete("*").from("Announcements");
|
||||||
|
Loading…
Reference in New Issue
Block a user