Merge pull request #11 from SDSRV-IDP/fe/fix-show-error2

fix: show error when call api failed
This commit is contained in:
Nguyen Viet Anh 2024-02-01 17:08:24 +07:00 committed by GitHub Enterprise
commit 54d1be4c34

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);
}
}