Skip to content

Commit

Permalink
fix(frontend): only call additional-feature API if one is set by user
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Sep 24, 2024
1 parent f4b43c7 commit ed97ef5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/frontend/src/api/CreateProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ const CreateProjectService = (
}

// post additional feature if available
const postAdditionalFeature = await dispatch(
PostAdditionalFeatureService(
`${import.meta.env.VITE_API_URL}/projects/${projectId}/additional-entity`,
additionalFeature,
),
);
if (additionalFeature) {
const postAdditionalFeature = await dispatch(
PostAdditionalFeatureService(
`${import.meta.env.VITE_API_URL}/projects/${projectId}/additional-entity`,
additionalFeature,
),
);

hasAPISuccess = postAdditionalFeature;
if (!hasAPISuccess) {
throw new Error(`Request failed`);
hasAPISuccess = postAdditionalFeature;
if (!hasAPISuccess) {
throw new Error(`Request failed`);
}
}

// Generate project files
Expand Down

0 comments on commit ed97ef5

Please sign in to comment.