This commit is contained in:
Omer Sabic 2024-05-07 19:18:46 +02:00
parent d51cc84a51
commit 3f8ba248cc
3 changed files with 3 additions and 3 deletions

View File

@ -1,3 +1,3 @@
export const config = { export const config = {
api_url: "http://api.omersabic.com:3001" api_url: "http://localhost:3000"
} }

View File

@ -44,7 +44,7 @@
<form id="blog_editor" action="?/edit" method="post" use:enhance> <form id="blog_editor" action="?/edit" method="post" use:enhance>
<Form.Field {form} name="blog_editor"> <Form.Field {form} name="blog_editor">
<Form.Control let:attrs> <Form.Control let:attrs>
<Input name="id" id="id" value={article_data?.id} class="hidden" /> <Input name="id" id="id" value={article_data?.id} class="hidden" readonly />
<div> <div>
<Label for="is_public_switch">Public</Label> <Label for="is_public_switch">Public</Label>
<Switch name="is_public" bind:checked={$formData.is_public} /> <Switch name="is_public" bind:checked={$formData.is_public} />

View File

@ -4,7 +4,7 @@ import { articles } from "../store";
/** @type {import("./$types").PageServerLoad} */ /** @type {import("./$types").PageServerLoad} */
export async function load(event) { export async function load(event) {
const result = await fetch(config.api_url + "/blog/article?id=" + event.params.article_id).then(x=>x.json()); const result = await fetch(config.api_url + "/blog/article?slug=" + event.params.article_id).then(x=>x.json());
if(!result.article) error(404) if(!result.article) error(404)