Add user id field to article table

This commit is contained in:
thiloho
2024-08-07 16:25:05 +02:00
parent 4a54ce4d00
commit 75aac7b1bc
5 changed files with 65 additions and 62 deletions

View File

@@ -63,7 +63,7 @@ export const load: PageServerLoad = async ({ params, fetch, cookies, url, parent
};
export const actions: Actions = {
createArticle: async ({ request, fetch, cookies, params }) => {
createArticle: async ({ request, fetch, cookies, params, locals }) => {
const data = await request.formData();
const res = await fetch("http://localhost:3000/article", {
@@ -74,6 +74,7 @@ export const actions: Actions = {
},
body: JSON.stringify({
website_id: params.websiteId,
user_id: locals.user.id,
title: data.get("title")
})
});