Add rename option for locations with inline edit
Deploy to LXC / deploy (push) Successful in 27s

Pencil icon on each location opens inline form to edit name and
description. Saves via rename action, cancel to discard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 16:52:13 +07:00
parent 5e4021bc60
commit 63b57e8ac3
2 changed files with 73 additions and 28 deletions
@@ -68,6 +68,20 @@ export const actions: Actions = {
return { created: true };
},
rename: async ({ request }) => {
const formData = await request.formData();
const id = formData.get('id') as string;
const name = (formData.get('name') as string)?.trim();
const description = (formData.get('description') as string)?.trim();
if (!name) return fail(400, { error: 'Name is required' });
await db
.update(locations)
.set({ name, description: description || null, updatedAt: new Date() })
.where(eq(locations.id, id));
return { renamed: true };
},
delete: async ({ request }) => {
const formData = await request.formData();
const id = formData.get('id') as string;