This commit is contained in:
@@ -25,6 +25,7 @@ interface CompanyFormSectionsOptions {
|
||||
categoryItems: ILabelValue[];
|
||||
watch: UseFormWatch<ICreateCompanyCredentials>;
|
||||
setValue: UseFormSetValue<ICreateCompanyCredentials>;
|
||||
persistDocumentFileIds?: (ids: string[]) => Promise<void>;
|
||||
}
|
||||
|
||||
const optionalNumber = (value: unknown) => {
|
||||
@@ -240,6 +241,7 @@ export const createCompanyFormSections = ({
|
||||
categoryItems,
|
||||
watch,
|
||||
setValue,
|
||||
persistDocumentFileIds,
|
||||
}: CompanyFormSectionsOptions): DynamicFormSection<ICreateCompanyCredentials>[] => [
|
||||
{
|
||||
id: companyInformationSectionId,
|
||||
@@ -652,7 +654,14 @@ export const createCompanyFormSections = ({
|
||||
<CompanyDocuments
|
||||
companyId={editMode ? id : undefined}
|
||||
value={watch("document_file_ids") ?? []}
|
||||
onChange={(ids) => setValue("document_file_ids", ids)}
|
||||
onChange={(ids) =>
|
||||
setValue("document_file_ids", ids, {
|
||||
shouldDirty: true,
|
||||
shouldTouch: true,
|
||||
shouldValidate: true,
|
||||
})
|
||||
}
|
||||
onRemovePersist={persistDocumentFileIds}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user