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.

fix: handle multiple locations in the fallback case

Brad Barbine3a3a7d7a9ca
diff --git a/packages/integrations/src/slack.server.ts b/packages/integrations/src/slack.server.ts
index a0ede84dfc..e0e506a278 100644
--- a/packages/integrations/src/slack.server.ts
+++ b/packages/integrations/src/slack.server.ts
@@ -1,7 +1,5 @@
-// Server-side exports for Slack integration
export * from "./slack/lib/client";
-export * from "./slack/lib/service";
export * from "./slack/lib/messages";
+export * from "./slack/lib/service";
-// Re-export specific types to avoid conflicts
-export type { DocumentType } from "./slack/lib/service";
\ No newline at end of file
+export type { DocumentType } from "./slack/lib/service";
diff --git a/packages/integrations/src/slack/lib/service.ts b/packages/integrations/src/slack/lib/service.ts
index 6a35750e7e..ab1289cb66 100644
--- a/packages/integrations/src/slack/lib/service.ts
+++ b/packages/integrations/src/slack/lib/service.ts
@@ -319,12 +319,11 @@ export async function getCarbonEmployeeFromSlackId(
const location = await client
.from("location")
.select("id")
- .eq("companyId", carbonCompanyId)
- .single();
+ .eq("companyId", carbonCompanyId);
return {
data: {
id: "system",
- locationId: location.data?.id,
+ locationId: location.data?.[0]?.id,
},
error: null,
};