feat: populate assignedTo, createdBy while returning processed record

This commit is contained in:
2025-09-20 14:54:48 +05:30
parent ea94f1f8a1
commit c83bf98ec8

View File

@@ -9,9 +9,12 @@ import {
import { createNote } from "../note/note.service";
export async function getProcessedPermit(permitId: String, tenantId: String) {
return await processedModel.findOne({
$and: [{ tenantId: tenantId }, { pid: permitId }],
});
return await processedModel
.findOne({
$and: [{ tenantId: tenantId }, { pid: permitId }],
})
.populate({ path: "assignedTo", select: "pid name avatar" })
.populate({ path: "createdBy", select: "pid name avatar" });
}
export async function updateProcessed(