fix: Convert createchannel action into a named action
This commit is contained in:
parent
b69d2d0fef
commit
e0364bb90b
@ -24,7 +24,7 @@
|
|||||||
<Dialog.Header>
|
<Dialog.Header>
|
||||||
<Dialog.Title>Create Channel</Dialog.Title>
|
<Dialog.Title>Create Channel</Dialog.Title>
|
||||||
</Dialog.Header>
|
</Dialog.Header>
|
||||||
<form class="grid gap-4 py-4" use:enhance method="POST" action="/">
|
<form class="grid gap-4 py-4" use:enhance method="POST" action="/?/newchannel">
|
||||||
<Input
|
<Input
|
||||||
id="channelName"
|
id="channelName"
|
||||||
name="channelName"
|
name="channelName"
|
||||||
|
@ -10,7 +10,7 @@ export function load(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
default: async ({ request }) => {
|
newchannel: async ({ request }) => {
|
||||||
const form = await superValidate(request, zod(newChannelSchema));
|
const form = await superValidate(request, zod(newChannelSchema));
|
||||||
const channel = form.data.channelName;
|
const channel = form.data.channelName;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user