feature/IO-3487-Auto-Add-Profile-Watchers - Fix Auto Add on a profile level

This commit is contained in:
Dave
2025-12-22 14:18:13 -05:00
parent 4a7bb07345
commit 9b44dd844f
11 changed files with 81 additions and 28 deletions

View File

@@ -39,6 +39,7 @@ const autoAddWatchers = async (req) => {
const jobId = event?.data?.new?.id;
const shopId = event?.data?.new?.shopid;
const roNumber = event?.data?.new?.ro_number || "unknown";
const createdUserEmail = event?.data?.new?.created_user_email || "Unknown";
if (!jobId || !shopId) {
throw new Error(`Missing jobId (${jobId}) or shopId (${shopId}) for auto-add watchers`);
@@ -61,7 +62,8 @@ const autoAddWatchers = async (req) => {
const [notificationData, existingWatchersData] = await Promise.all([
gqlClient.request(GET_NOTIFICATION_WATCHERS, {
shopId,
employeeIds: notificationFollowers
employeeIds: notificationFollowers,
createdUserEmail
}),
gqlClient.request(GET_JOB_WATCHERS_MINIMAL, { jobid: jobId })
]);