feat(MED-97): fix occurance->occurrence in components, add missing translations

This commit is contained in:
2025-09-23 19:59:51 +03:00
parent 8af2c8710f
commit fb03d548af
11 changed files with 40 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ const HealthBenefitFields = () => {
return (
<div className="flex flex-col gap-3">
<FormField
name="occurance"
name="occurrence"
render={({ field }) => (
<FormItem>
<FormLabel>
@@ -30,20 +30,20 @@ const HealthBenefitFields = () => {
<Select {...field} onValueChange={field.onChange}>
<SelectTrigger>
<SelectValue
placeholder={<Trans i18nKey="common:formField:occurance" />}
placeholder={<Trans i18nKey="common:formField:occurrence" />}
/>
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem value="yearly">
<Trans i18nKey="billing:occurance.yearly" />
<Trans i18nKey="billing:occurrence.yearly" />
</SelectItem>
<SelectItem value="quarterly">
<Trans i18nKey="billing:occurance.quarterly" />
<Trans i18nKey="billing:occurrence.quarterly" />
</SelectItem>
<SelectItem value="monthly">
<Trans i18nKey="billing:occurance.monthly" />
<Trans i18nKey="billing:occurrence.monthly" />
</SelectItem>
</SelectGroup>
</SelectContent>

View File

@@ -39,13 +39,13 @@ const HealthBenefitForm = ({
resolver: zodResolver(UpdateHealthBenefitSchema),
mode: 'onChange',
defaultValues: {
occurance: currentCompanyParams.benefit_occurance || 'yearly',
occurrence: currentCompanyParams.benefit_occurance || 'yearly',
amount: currentCompanyParams.benefit_amount || 0,
},
});
const isDirty = form.formState.isDirty;
const onSubmit = (data: { occurance: string; amount: number }) => {
const onSubmit = (data: { occurrence: string; amount: number }) => {
const promise = async () => {
setIsLoading(true);
try {
@@ -53,7 +53,7 @@ const HealthBenefitForm = ({
setCurrentCompanyParams((prev) => ({
...prev,
benefit_amount: data.amount,
benefit_occurance: data.occurance,
benefit_occurance: data.occurrence,
}));
} finally {
form.reset(data);