fix: use schema-based deleteKey and reactive key list refresh

- Add deleteKeySchema for proper FormData validation
- Return { deleted: true } from deleteKey for change tracking
- Use $state for keysPromise to refresh list after create/delete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sanju Sivalingam
2026-02-17 14:43:46 +05:30
parent 9422e94a8e
commit 8fc5587876
3 changed files with 16 additions and 5 deletions

View File

@@ -3,3 +3,7 @@ import { object, string, pipe, minLength } from 'valibot';
export const createKeySchema = object({
name: pipe(string(), minLength(1))
});
export const deleteKeySchema = object({
keyId: pipe(string(), minLength(1))
});