Skip to content

Commit

Permalink
fixed deletion of old datamodel
Browse files Browse the repository at this point in the history
  • Loading branch information
JamalAlabdullah committed Feb 4, 2024
1 parent 661038e commit 923c1de
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ export const useDeleteDatamodelMutation = () => {
});
await deleteDatamodel(org, app, modelPath);

Check warning on line 27 in frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts

View check run for this annotation

Codecov / codecov/patch

frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts#L27

Added line #L27 was not covered by tests
},
onSuccess: (data, variables) => {
queryClient.setQueryData(
[QueryKey.DatamodelsJson, org, app],
(oldData: DatamodelMetadata[]) => removeDatamodelFromList(oldData, variables),

Check warning on line 32 in frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts

View check run for this annotation

Codecov / codecov/patch

frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts#L32

Added line #L32 was not covered by tests
);
queryClient.setQueryData([QueryKey.DatamodelsXsd, org, app], (oldData: DatamodelMetadata[]) =>
removeDatamodelFromList(oldData, variables),

Check warning on line 35 in frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts

View check run for this annotation

Codecov / codecov/patch

frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts#L34-L35

Added lines #L34 - L35 were not covered by tests
);
queryClient.removeQueries({ queryKey: [QueryKey.JsonSchema, org, app, variables] });

Check warning on line 37 in frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts

View check run for this annotation

Codecov / codecov/patch

frontend/app-development/hooks/mutations/useDeleteDatamodelMutation.ts#L37

Added line #L37 was not covered by tests
},
});
};

Expand Down

0 comments on commit 923c1de

Please sign in to comment.