add assignedTo field to unique fields endpoint

This commit is contained in:
2025-05-13 13:49:39 +05:30
parent d9397e572b
commit 4028c05d5f
6 changed files with 65 additions and 4 deletions

View File

@@ -181,7 +181,8 @@ export async function updateRts(
.findOneAndUpdate({ pid: id, tenantId: tenantId }, input, { new: true })
.populate({ path: "createdBy", select: "pid name avatar" })
.populate({ path: "county", select: "pid name avatar" })
.populate({ path: "client", select: "pid name avatar" });
.populate({ path: "client", select: "pid name avatar" })
.populate({ path: "assignedTo", select: "pid name avatar" });
return updatedRts;
}
@@ -219,6 +220,8 @@ export async function getUniqueValuesRTS(field: string, tenenatId: string) {
matchedValues = await orgModel.find().where("_id").in(values).exec();
} else if (field === "createdBy") {
matchedValues = await userModel.find().where("_id").in(values).exec();
} else if (field === "assignedTo") {
matchedValues = await userModel.find().where("_id").in(values).exec();
}
if (matchedValues.length > 0) {