Skip to content

Commit

Permalink
1660 - Link Query Examples to Terms
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladysl committed Apr 25, 2024
1 parent ac59334 commit cc91d11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ const AssignTermQueryExampleForm: React.FC<AssignTermQueryFormProps> = ({
reValidateMode: 'onChange',
});

const clear = () => {
reset();
};

const onSubmit = ({ exampleId }: FormData) => {
mutateAsync({
queryExampleTermFormData: {
Expand Down Expand Up @@ -83,7 +79,7 @@ const AssignTermQueryExampleForm: React.FC<AssignTermQueryFormProps> = ({
renderContent={formContent}
renderActions={actionButton}
handleCloseSubmittedForm={isSuccess}
clearState={clear}
clearState={reset}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface Props {

const QueryExamplesTermUnlinkButton = ({ termId, queryExampleId }: Props) => {
const { t } = useTranslation();
const { mutateAsync: unlink } = useUnassignTermQueryExample(termId);
const { mutateAsync: unlink } = useUnassignTermQueryExample();
return (
<ConfirmationDialog
actionTitle={t('Are you sure you want to unlink this query example?')}
Expand Down
4 changes: 2 additions & 2 deletions odd-platform-ui/src/lib/hooks/api/terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export function useAssignTermQueryExample(termId: number) {
});
}

export function useUnassignTermQueryExample(termId: number) {
export function useUnassignTermQueryExample() {
const queryClient = useQueryClient();

return useMutation({
mutationKey: ['unassignTermQueryExample'],
mutationFn: async ({
exampleId,
termId
}: TermApiDeleteQueryExampleToTermRelationshipRequest) =>
termApi.deleteQueryExampleToTermRelationship({
termId,
Expand Down

0 comments on commit cc91d11

Please sign in to comment.