Fix lint debt from admin overhaul; make check/lint/test/build green
- Scope @typescript-eslint/no-explicit-any off for *.spec.ts test doubles - Type enhance() submit callbacks with SubmitFunction in api-keys page - Drop as-any casts in proclamations upsert by using typed form data - Fix useless regex escapes in profiles phone validation - Remove unused locals param from api-keys load - Use resolve() for admin nav/error links; store literal hrefs in adminModels - Update README admin section and ADMIN_OVERHAUL lint caveat
This commit is contained in:
@@ -73,7 +73,6 @@ export const actions = {
|
||||
}
|
||||
|
||||
const rawId = formData.get('id')?.toString();
|
||||
const data: Record<string, unknown> = { ...form.data };
|
||||
|
||||
try {
|
||||
if (rawId) {
|
||||
@@ -81,9 +80,9 @@ export const actions = {
|
||||
if (!existing) {
|
||||
return { success: false, action: 'upsert', error: 'Record not found' };
|
||||
}
|
||||
await prisma.proclamation.update({ where: { id: rawId }, data: data as any });
|
||||
await prisma.proclamation.update({ where: { id: rawId }, data: form.data });
|
||||
} else {
|
||||
await prisma.proclamation.create({ data: data as any });
|
||||
await prisma.proclamation.create({ data: form.data });
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
if (e && typeof e === 'object' && 'code' in e && (e as { code: string }).code === 'P2002') {
|
||||
|
||||
Reference in New Issue
Block a user