Skip to content

Commit

Permalink
refactor. return the errors in axios calls
Browse files Browse the repository at this point in the history
  • Loading branch information
abinaya-u committed Oct 31, 2023
1 parent fa5fd72 commit f5a2d4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const fetchAllergiesData = async (patientUuid) => {
const response = await axios.get(FETCH_ALLERGIES_URL);
return response;
} catch (error) {
console.error(error);
return error;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useFetchMedications.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const useFetchMedications = (patientUuid, forDate) => {
const response = await fetchMedications(patientUuid, forDate);
setDrugChartData(response.data);
} catch (e) {
console.log(e);
return e;
} finally {
setLoading(false);
}
Expand Down

0 comments on commit f5a2d4b

Please sign in to comment.