add get notification route

This commit is contained in:
2025-06-27 14:53:42 +05:30
parent 76e703d5f0
commit 6e73e32df7
3 changed files with 40 additions and 1 deletions

View File

@@ -12,7 +12,6 @@ import {
} from "./notification.schema";
import { getUser } from "../user/user.service";
import { createNote } from "../note/note.service";
import { permitModel } from "../permit/permit.schema";
import { createAlert } from "../alert/alert.service";
export async function createNotification(
@@ -31,6 +30,16 @@ export async function createNotification(
.populate({ path: "assignedTo", select: "pid name avatar" });
}
export async function getNotification(
notifId: string,
user: AuthenticatedUser
) {
return await notificationModel.findOne({
tenantId: user.tenantId,
pid: notifId,
});
}
export async function updateNotification(
notifId: string,
input: UpdateNotificationInput,