feat: populate assignedTo, createdBy while returning processed record
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user