Admin page
This commit is contained in:
+2
-1
@@ -9,6 +9,7 @@ interface FormProps<T> {
|
||||
on_error?: (message: string) => void;
|
||||
class?: string;
|
||||
method?: string;
|
||||
headers?: Record<string, string>;
|
||||
children: ComponentChildren;
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ export default function Form<T = unknown>(props: FormProps<T>) {
|
||||
|
||||
submitting.value = true;
|
||||
error.value = "";
|
||||
const result = await post_json<T>(props.action, body, props.method);
|
||||
const result = await post_json<T>(props.action, body, props.method, props.headers);
|
||||
submitting.value = false;
|
||||
|
||||
if (result.ok) props.on_success(result.data);
|
||||
|
||||
Reference in New Issue
Block a user