improve
This commit is contained in:
parent
d51cc84a51
commit
3f8ba248cc
@ -1,3 +1,3 @@
|
|||||||
export const config = {
|
export const config = {
|
||||||
api_url: "http://api.omersabic.com:3001"
|
api_url: "http://localhost:3000"
|
||||||
}
|
}
|
@ -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} />
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user