feat: populate assignedTo field for get notification response

This commit is contained in:
2025-09-24 12:36:08 +05:30
parent 444f909bac
commit b68ab704da
2 changed files with 12 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import {
} from "./processed.schema";
import { createNote } from "../note/note.service";
import { createAlert } from "../alert/alert.service";
import { getUser } from "../user/user.service";
export async function getProcessedPermit(permitId: String, tenantId: String) {
return await processedModel
@@ -48,6 +49,11 @@ export async function updateProcessed(
if (input[key] === null) {
msg = `Cleared ${key}`;
} else if (key == "assignedTo") {
const user = await getUser(input.assignedTo);
if (!user) continue;
msg = `Assigned to ${user.firstName + " " + user.lastName}`;
} else {
msg = `Updated ${key} to '${input[key]}'`;
}