feat: populate assignedTo field for get notification response
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
||||
getTaggedUsersFilter,
|
||||
PageQueryParams,
|
||||
} from "../pagination";
|
||||
import { userModel } from "../user/user.schema";
|
||||
import { generateId } from "../utils/id";
|
||||
import {
|
||||
CreateNotificationInput,
|
||||
@@ -39,10 +38,12 @@ export async function getNotification(
|
||||
notifId: string,
|
||||
user: AuthenticatedUser
|
||||
) {
|
||||
return await notificationModel.findOne({
|
||||
tenantId: user.tenantId,
|
||||
pid: notifId,
|
||||
});
|
||||
return await notificationModel
|
||||
.findOne({
|
||||
tenantId: user.tenantId,
|
||||
pid: notifId,
|
||||
})
|
||||
.populate({ path: "assignedTo", select: "pid name avatar" });
|
||||
}
|
||||
|
||||
export async function updateNotification(
|
||||
|
||||
Reference in New Issue
Block a user