Skip to content

Commit

Permalink
Merge pull request #194 from tableflowhq/fix/sdk-defined-template
Browse files Browse the repository at this point in the history
Setting template object correctly when SDK-defined and stored
  • Loading branch information
ciminelli committed Dec 14, 2023
2 parents ea13b65 + 7cc233a commit 9f0f80f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions importer-ui/src/features/main/hooks/useApi.ts
Expand Up @@ -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);

Expand All @@ -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 {
Expand Down

0 comments on commit 9f0f80f

Please sign in to comment.