Merge pull request 'hotfix: #7323 catch mail err' (!1225) from hotfix-7323-catchMailErr into master
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1225 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
6ca732986d
|
@ -283,21 +283,22 @@ const fetchWeekData = async () => {
|
|||
year: selectedDateYear.value,
|
||||
week: selectedWeekNumber.value,
|
||||
};
|
||||
const mail = (
|
||||
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
})
|
||||
).data[0];
|
||||
try {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
}),
|
||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
]);
|
||||
|
||||
if (!mail) state.value = null;
|
||||
else {
|
||||
state.value = mail.state;
|
||||
reason.value = mail.reason;
|
||||
const mail = mailData[0];
|
||||
|
||||
state.value = mail?.state;
|
||||
reason.value = mail?.reason;
|
||||
canResend.value = !!countData.count;
|
||||
} catch {
|
||||
state.value = null;
|
||||
}
|
||||
|
||||
canResend.value = !!(
|
||||
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
|
||||
).data.count;
|
||||
};
|
||||
|
||||
const setHours = (data) => {
|
||||
|
|
Loading…
Reference in New Issue