fix(admin): rename users edit default action to named update
SvelteKit 2 forbids mixing a `default` action with named actions; the page also exports a `delete` action. Posting the edit form therefore returned a 500 with "When using named actions, the default action cannot be used." Rename the action to `update` and point the form at `?/update`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ export const load: PageServerLoad = async ({ params, fetch, locals }) => {
|
||||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
default: async ({ params, request, fetch }) => {
|
||||
update: async ({ params, request, fetch }) => {
|
||||
const data = await request.formData();
|
||||
|
||||
const newPassword = data.get('newPassword') as string;
|
||||
|
||||
@@ -84,6 +84,7 @@ $effect(() => {
|
||||
<form
|
||||
id="edit-user-form"
|
||||
method="POST"
|
||||
action="?/update"
|
||||
use:enhance
|
||||
oninput={unsaved.markDirty}
|
||||
class="space-y-5"
|
||||
|
||||
Reference in New Issue
Block a user