fix: show error when call api failed

This commit is contained in:
Vu Khanh Du 2024-02-01 16:37:50 +07:00
parent c7e6c3599b
commit 87cd95c842

View File

@ -1,3 +1,4 @@
import { notification } from 'antd';
import {
MakeReportParams,
MakeReportResponse,
@ -22,6 +23,9 @@ export async function getReportDetailList(params: ReportDetailListParams) {
);
return response.data;
} catch (error) {
notification.error({
message: `${error?.message}`,
});
console.log(error);
}
}
@ -38,6 +42,9 @@ export async function makeReport(params: MakeReportParams) {
});
return response.data;
} catch (error) {
notification.error({
message: `${error?.message}`,
});
console.log(error);
}
}
@ -54,6 +61,9 @@ export async function getReportList(params?: ReportListParams) {
});
return response.data;
} catch (error) {
notification.error({
message: `${error?.message}`,
});
console.log(error);
}
}
@ -71,6 +81,9 @@ export async function getOverViewReport(params?: ReportListParams) {
});
return response.data;
} catch (error) {
notification.error({
message: `${error?.message}`,
});
console.log(error);
}
}
@ -87,6 +100,9 @@ export async function downloadReport(report_id: string) {
// window.open(fileURL);
return file;
} catch (error) {
notification.error({
message: `${error?.message}`,
});
console.log(error);
}
}