prettier fix

This commit is contained in:
Danel Kungla
2025-09-19 17:22:36 +03:00
parent efa94b3322
commit 0c2cfe6d18
509 changed files with 17988 additions and 9920 deletions

View File

@@ -1,6 +1,6 @@
import { z } from 'zod';
import Isikukood from 'isikukood';
import parsePhoneNumber from 'libphonenumber-js/min';
import { z } from 'zod';
const updateAccountSchema = {
firstName: z
@@ -39,14 +39,18 @@ const updateAccountSchema = {
(phone) => {
try {
const phoneNumber = parsePhoneNumber(phone);
return !!phoneNumber && phoneNumber.isValid() && phoneNumber.country === 'EE';
return (
!!phoneNumber &&
phoneNumber.isValid() &&
phoneNumber.country === 'EE'
);
} catch {
return false;
}
},
{
message: 'common:formFieldError.invalidPhoneNumber',
}
},
),
city: z.string().optional(),
weight: z
@@ -81,22 +85,27 @@ export const UpdateAccountSchemaServer = z.object({
height: updateAccountSchema.height.nullable(),
userConsent: updateAccountSchema.userConsent,
});
export const UpdateAccountSchemaClient = ({ isEmailUser }: { isEmailUser: boolean }) => z.object({
firstName: updateAccountSchema.firstName,
lastName: updateAccountSchema.lastName,
personalCode: updateAccountSchema.personalCode,
email: updateAccountSchema.email,
phone: updateAccountSchema.phone,
...(isEmailUser
? {
city: z.string().optional(),
weight: z.number().optional(),
height: z.number().optional(),
}
: {
city: updateAccountSchema.city,
weight: updateAccountSchema.weight,
height: updateAccountSchema.height,
}),
userConsent: updateAccountSchema.userConsent,
});
export const UpdateAccountSchemaClient = ({
isEmailUser,
}: {
isEmailUser: boolean;
}) =>
z.object({
firstName: updateAccountSchema.firstName,
lastName: updateAccountSchema.lastName,
personalCode: updateAccountSchema.personalCode,
email: updateAccountSchema.email,
phone: updateAccountSchema.phone,
...(isEmailUser
? {
city: z.string().optional(),
weight: z.number().optional(),
height: z.number().optional(),
}
: {
city: updateAccountSchema.city,
weight: updateAccountSchema.weight,
height: updateAccountSchema.height,
}),
userConsent: updateAccountSchema.userConsent,
});

View File

@@ -4,9 +4,8 @@ import { updateCustomer } from '@lib/data/customer';
import { AccountSubmitData, createAuthApi } from '@kit/auth/api';
import { enhanceAction } from '@kit/next/actions';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { pathsConfig } from '@kit/shared/config';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { UpdateAccountSchemaServer } from '../schemas/update-account.schema';
@@ -32,14 +31,14 @@ export const onUpdateAccount = enhanceAction(
phone: params.phone,
});
} catch (e) {
console.error("Failed to update Medusa customer", e);
console.error('Failed to update Medusa customer', e);
}
const hasUnseenMembershipConfirmation =
await api.hasUnseenMembershipConfirmation();
return {
hasUnseenMembershipConfirmation,
}
};
},
{
schema: UpdateAccountSchemaServer,

View File

@@ -1,6 +1,5 @@
import { withI18n } from '~/lib/i18n/with-i18n';
async function SiteLayout(props: React.PropsWithChildren) {
return (
<div className={'flex min-h-[100vh] flex-col items-center justify-center'}>