Resolves #1 Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
@@ -7,6 +7,7 @@ import * as v from 'valibot';
|
||||
import { ensureAuth } from '$lib/auth';
|
||||
import { db } from '$lib/server/db';
|
||||
import { aktis } from '$lib/server/db/schema';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
await ensureAuth(event);
|
||||
return {};
|
||||
@@ -28,6 +29,8 @@ export const actions = {
|
||||
|
||||
if (!akti) return {};
|
||||
|
||||
akti.body = sanitizeHtml(akti.body);
|
||||
|
||||
const res = await db
|
||||
.insert(aktis)
|
||||
.values({ ...akti, author: user.id! })
|
||||
|
||||
Reference in New Issue
Block a user