Skip to content

Commit

Permalink
Simplify async/await logic
Browse files Browse the repository at this point in the history
  • Loading branch information
danetsao committed Feb 7, 2024
1 parent f45e6c1 commit a564427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/api/mutators/useAutomaticSchedulerMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,11 @@ export default function useAutomaticSchedulerMutation() {
}
);

return async (parameters: {
return (parameters: {
bursar: BursarExportJobDTO;
scheduling: SchedulingDTO;
}) => {
try {
mutation.mutate(parameters);
} catch (e) {}
mutation.mutate(parameters);
return {};
};
}
6 changes: 2 additions & 4 deletions src/api/mutators/useManualSchedulerMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ export default function useManualSchedulerMutation() {
}
);

return async (parameters: BursarExportJobDTO) => {
try {
mutation.mutate(parameters);
} catch (e) {}
return (parameters: BursarExportJobDTO) => {
mutation.mutate(parameters);
return {};
};
}

0 comments on commit a564427

Please sign in to comment.