fixing absensi
This commit is contained in:
@@ -65,13 +65,14 @@ const create = async (req, res) => {
|
|||||||
date: today,
|
date: today,
|
||||||
}, { transaction: t });
|
}, { transaction: t });
|
||||||
|
|
||||||
|
if (attendance && ['sick', 'permission'].includes(attendance.type)) {
|
||||||
|
await t.rollback()
|
||||||
|
return response.failed(res, 400, `Hari ini Anda sudah absen ${attendance.type}`);
|
||||||
|
}
|
||||||
|
|
||||||
await t.commit();
|
await t.commit();
|
||||||
return response.success(res, attendance, 'Izin berhasil disimpan');
|
return response.success(res, attendance, 'Izin berhasil disimpan');
|
||||||
}
|
}
|
||||||
if (attendance && ['sick', 'permission'].includes(attendance.type)) {
|
|
||||||
await t.rollback()
|
|
||||||
return response.failed(res, 400, `Hari ini Anda sudah absen ${attendance.type}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attendance && attendance.clock_in) {
|
if (attendance && attendance.clock_in) {
|
||||||
// 🕛 Jika branch tidak mengaktifkan absen siang
|
// 🕛 Jika branch tidak mengaktifkan absen siang
|
||||||
|
|||||||
Reference in New Issue
Block a user