fix: reminder monthly in db device

This commit is contained in:
2026-07-08 11:47:11 +07:00
parent 1c56239fc8
commit a52efeceb5
2 changed files with 4 additions and 5 deletions

View File

@@ -155,15 +155,14 @@ const getDeviceReminderMonthlyDb = async (id) => {
return result.recordset;
};
const updateDeviceReminderMonthlyDb = async (deviceId, reminderMonthly, period) => {
const updateDeviceReminderMonthlyDb = async (deviceId, reminderMonthly) => {
const queryText = `
UPDATE m_device
SET reminder_at_monthly = $1,
period = $2
updated_at = CURRENT_TIMESTAMP
WHERE device_id = $2 AND deleted_at IS NULL
`;
await pool.query(queryText, [reminderMonthly, deviceId, period]);
await pool.query(queryText, [reminderMonthly, deviceId]);
return getDeviceByIdDb(deviceId);
};

View File

@@ -614,7 +614,7 @@ class NotifikasiWaService {
}
async onMonthlyReminder(deviceId, reminderMonthly, period) {
async onMonthlyReminder(deviceId, reminderMonthly) {
try {
const paramDb = {
@@ -1179,7 +1179,7 @@ class NotifikasiWaService {
`Diberitahukan bahwa terdapat sparepart pada device "${deviceName}" ` +
`yang telah memasuki jadwal perawatan.\n\n` +
`Silakan segera lakukan pengecekan dan perawatan untuk memastikan kinerja tetap optimal.\n\n` +
`Detail Periode Perawatan:\n` +
`Detaile Perawatan:\n` +
`Start Date: ${startDateObj.format('DD-MM-YYYY HH:mm')}\n` +
`End Date: ${endDateObj.format('DD-MM-YYYY HH:mm')}\n`