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.

refactor: add logging for diagnosing slack interactive endpoint error

Brad Barbin1c707d1c58c0
diff --git a/apps/erp/app/routes/api+/integrations.slack.interactive.ts b/apps/erp/app/routes/api+/integrations.slack.interactive.ts
index 13d6c60d41..46410c0cc0 100644
--- a/apps/erp/app/routes/api+/integrations.slack.interactive.ts
+++ b/apps/erp/app/routes/api+/integrations.slack.interactive.ts
@@ -97,6 +97,7 @@ export async function action({ request }: ActionFunctionArgs) {
);
if (!integration.data || integration.error) {
+ console.error("Failed to get Slack integration", integration.error);
return json({
response_type: "ephemeral",
text: "Slack integration not found for this workspace.",
@@ -107,6 +108,7 @@ export async function action({ request }: ActionFunctionArgs) {
const slackToken = (metadata as any)?.access_token as string;
if (!slackToken) {
+ console.error("Slack token not found");
return json({
response_type: "ephemeral",
text: "Slack token not found. Please reconfigure the integration.",
@@ -182,7 +184,7 @@ async function handleShortcut(
) {
// Handle different shortcut types based on callback_id
const callbackId = payload.callback_id;
-
+ console.log({ function: "handleShortcut", callbackId });
switch (callbackId) {
case "create_ncr_modal":
return handleCreateNcrShortcut(
@@ -377,6 +379,7 @@ async function handleViewSubmission(
serviceRole: SupabaseClient<Database>,
integration: any
) {
+ console.log({ function: "handleViewSubmission", payload });
const view = payload.view;
if (view.callback_id !== "create_ncr_modal") {