fix: catch mail err
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
1f76d572ce
commit
21958cfdb4
|
@ -283,21 +283,22 @@ const fetchWeekData = async () => {
|
||||||
year: selectedDateYear.value,
|
year: selectedDateYear.value,
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
};
|
};
|
||||||
const mail = (
|
try {
|
||||||
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||||
params: { filter: { where } },
|
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||||
})
|
params: { filter: { where } },
|
||||||
).data[0];
|
}),
|
||||||
|
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||||
|
]);
|
||||||
|
|
||||||
if (!mail) state.value = null;
|
const mail = mailData[0];
|
||||||
else {
|
|
||||||
state.value = mail.state;
|
state.value = mail?.state;
|
||||||
reason.value = mail.reason;
|
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) => {
|
const setHours = (data) => {
|
||||||
|
|
Loading…
Reference in New Issue