Updated deleteObject function in database.js to convert ID values to strings before logging deletions and notifications, ensuring consistent data handling across operations.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-07-25 01:36:20 +01:00
parent 13ddcbce61
commit 5e71afe246

View File

@ -998,14 +998,14 @@ export const deleteObject = async (
const deleted = expandObjectIds(result.toObject());
// Audit log the deletion
await deleteAuditLog(deleted, id, parentType, user);
await deleteAuditLog(deleted, id.toString(), parentType, user);
if (
parentType !== 'notification' &&
parentType !== 'auditLog' &&
parentType !== 'userNotifier'
) {
await deleteNotification(deleted, id, parentType, user);
await deleteNotification(deleted, id.toString(), parentType, user);
}
if (distributeChanges == true) {