Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: remove user from the group if the user is the one who created the notification

Brad Barbin51f28a7e95cd
diff --git a/apps/erp/app/trigger/notify.ts b/apps/erp/app/trigger/notify.ts
index 2a8109b756..acecc49024 100644
--- a/apps/erp/app/trigger/notify.ts
+++ b/apps/erp/app/trigger/notify.ts
@@ -244,8 +244,13 @@ export const notifyTask = task({
return;
}
+ // Filter out the sender from recipients if they exist in the userIds
+ const filteredUserIds = payload.from
+ ? (userIds.data as string[]).filter((id) => id !== payload.from)
+ : (userIds.data as string[]);
+
const notificationPayloads: TriggerPayload[] =
- [...new Set(userIds.data as string[])].map((userId) => ({
+ [...new Set(filteredUserIds)].map((userId) => ({
workflow,
payload: {
recordId: payload.documentId,
diff --git a/packages/database/supabase/migrations/20250122130509_rfq-ready-notification.sql b/packages/database/supabase/migrations/20250122130509_rfq-ready-notification.sql
new file mode 100644
index 0000000000..561626d42a
--- /dev/null
+++ b/packages/database/supabase/migrations/20250122130509_rfq-ready-notification.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "companySettings"
+ ADD COLUMN "rfqReadyNotificationGroup" TEXT[] NOT NULL DEFAULT '{}';