Skip to content

Commit

Permalink
🐛 Fix missing notification for adding tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jul 20, 2023
1 parent 0b20ab3 commit 4f6d366
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions client/src/app/pages/external/jira/tracker-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ export const TrackerForm: React.FC<TrackerFormProps> = ({

const { pushNotification } = React.useContext(NotificationsContext);

const onCreateTrackerSuccess = (_: AxiosResponse<Tracker>) =>
const onCreateTrackerSuccess = (_: AxiosResponse<Tracker>) => {
pushNotification({
title: t("toastr.success.save", {
type: t("terms.instance").toLocaleLowerCase(),
type: t("terms.instance"),
}),
variant: "success",
});
};

const onCreateUpdatetrackerError = (error: AxiosError) => {
setAxiosError(error);
Expand All @@ -95,7 +96,7 @@ export const TrackerForm: React.FC<TrackerFormProps> = ({
const onUpdateTrackerSuccess = (_: AxiosResponse<Tracker>) =>
pushNotification({
title: t("toastr.success.save", {
type: t("terms.instance").toLocaleLowerCase(),
type: t("terms.instance"),
}),
variant: "success",
});
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/queries/trackers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const useCreateTrackerMutation = (
const queryClient = useQueryClient();
return useMutation({
mutationFn: createTracker,
onSuccess: () => {
onSuccess;
onSuccess: (res) => {
onSuccess(res);
queryClient.invalidateQueries([TrackersQueryKey]);
},
onError: onError,
Expand Down

0 comments on commit 4f6d366

Please sign in to comment.