admin: Superforms + Zod validation, three-address-defaults schema, profiles toast fix

- Add Superforms + Zod 4 for all admin form validation
- Replace address isDefault with three separate boolean defaults (Mailing, Billing, Shipping)
- Update profiles page with three-checkbox address form and toast improvements
- Convert all admin page server actions to pass request directly to crud
- Export superFormErrorsToFieldErrors helper for profiles server actions
- Regenerate Prisma client for new schema fields
This commit is contained in:
NeilClack
2026-07-07 13:36:23 -05:00
parent 38347f5f24
commit 38d1752f5b
98 changed files with 3408 additions and 1758 deletions
+3 -10
View File
@@ -89,8 +89,7 @@ describe('reset-password page server action', () => {
resetPassword.mockReset();
});
const invokeDefault = (url: URL, request: Request) =>
actions.default({ request, url } as any);
const invokeDefault = (url: URL, request: Request) => actions.default({ request, url } as any);
it('returns fail(400) when token is missing', async () => {
const url = createUrl('/reset-password');
@@ -120,10 +119,7 @@ describe('reset-password page server action', () => {
it('returns fail(400) when password is empty', async () => {
const url = createUrl('/reset-password', { token: 'token-1' });
const result = await invokeDefault(
url,
createFormRequest({ password: '', password2: '' })
);
const result = await invokeDefault(url, createFormRequest({ password: '', password2: '' }));
expect(isActionFailure(result)).toBe(true);
if (isActionFailure(result)) {
expect(result.data).toEqual({ error: 'Password must be at least 8 characters.' });
@@ -181,10 +177,7 @@ describe('reset-password page server action', () => {
const url = createUrl('/reset-password', { token: 'token-1' });
const err = await Promise.resolve(
invokeDefault(
url,
createFormRequest({ password: 'longenough1', password2: 'longenough1' })
)
invokeDefault(url, createFormRequest({ password: 'longenough1', password2: 'longenough1' }))
).catch((e: unknown) => e);
expect(isRedirect(err)).toBe(true);
if (isRedirect(err)) {