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
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit is contained in:
parent
13ddcbce61
commit
5e71afe246
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user