diff --git a/importer-ui/src/features/main/hooks/useApi.ts b/importer-ui/src/features/main/hooks/useApi.ts index b7e46c91..30817999 100644 --- a/importer-ui/src/features/main/hooks/useApi.ts +++ b/importer-ui/src/features/main/hooks/useApi.ts @@ -17,7 +17,7 @@ export default function useApi(importerId: string, sdkDefinedTemplate: string, c isLoading: importerIsLoading, error: importerError, } = useGetImporter(importerId, sdkDefinedTemplate, schemaless); - const { template = {} as Template } = importer; + let { template = {} as Template } = importer; const { data: organizationStatus, isLoading: statusIsLoading = {} } = useGetOrganization(importerId, checkOrganizationStatus); @@ -37,8 +37,8 @@ export default function useApi(importerId: string, sdkDefinedTemplate: string, c }); const reviewIsStored = enabledReview ? review?.is_stored || false : false; - if (importer?.template?.is_sdk_defined && upload?.is_stored && upload?.template) { - importer.template = upload.template; + if (template?.is_sdk_defined && upload?.is_stored && upload?.template) { + template = upload.template; } return {