@openinc/parse-server-opendash 3.17.1 → 3.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,7 @@ async function assignUsersAndRoles(ticket, assignedTo, fetchOptions, assigningUs
|
|
|
40
40
|
batchStamp: batchTime,
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
+
const userNotifiedIds = [];
|
|
43
44
|
for (const assignedTo of newUsers) {
|
|
44
45
|
assignments.push(new types_1.Maintenance_Ticket_Assignment({
|
|
45
46
|
ticket,
|
|
@@ -48,6 +49,8 @@ async function assignUsersAndRoles(ticket, assignedTo, fetchOptions, assigningUs
|
|
|
48
49
|
user: ticket.get("user"),
|
|
49
50
|
batchStamp: batchTime,
|
|
50
51
|
}));
|
|
52
|
+
if (assignedTo.id === assigningUser?.id)
|
|
53
|
+
continue;
|
|
51
54
|
await new types_1.Notification({
|
|
52
55
|
data: {
|
|
53
56
|
ticketId: ticket.id,
|
|
@@ -62,6 +65,7 @@ async function assignUsersAndRoles(ticket, assignedTo, fetchOptions, assigningUs
|
|
|
62
65
|
user: assignedTo,
|
|
63
66
|
description: "maintenance:ticket.assignuser.notification.description",
|
|
64
67
|
}).save(null, fetchOptions);
|
|
68
|
+
userNotifiedIds.push(assignedTo.id);
|
|
65
69
|
}
|
|
66
70
|
for (const assignedTo of newRoles) {
|
|
67
71
|
assignments.push(new types_1.Maintenance_Ticket_Assignment({
|
|
@@ -76,6 +80,9 @@ async function assignUsersAndRoles(ticket, assignedTo, fetchOptions, assigningUs
|
|
|
76
80
|
.query()
|
|
77
81
|
.find(fetchOptions);
|
|
78
82
|
for (const roleUser of roleUsers) {
|
|
83
|
+
if (userNotifiedIds.includes(roleUser.id) ||
|
|
84
|
+
roleUser.id === assigningUser?.id)
|
|
85
|
+
continue;
|
|
79
86
|
await new types_1.Notification({
|
|
80
87
|
data: {
|
|
81
88
|
ticketId: ticket.id,
|