From eae9655c741bf5d90988b3aa84bde1a90097d94a Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Mon, 11 May 2026 13:54:24 -0400 Subject: [PATCH] Remove unused Slack notification code --- lambda/index.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/lambda/index.js b/lambda/index.js index 339d60b..3d24bef 100644 --- a/lambda/index.js +++ b/lambda/index.js @@ -10,7 +10,6 @@ * GOOGLE_ADMIN_EMAIL - Email of a Google Workspace admin to impersonate * GOOGLE_DOMAIN - Domain to list users for (e.g. seahaven.com) * GOOGLE_OUS - Comma-separated org unit paths to sync (e.g. /Office/Scheduling,/Office/Operations) - * SLACK_WEBHOOK_URL - (Optional) Slack incoming webhook for sync summaries */ const { @@ -191,36 +190,6 @@ async function updateFrontTeammate(frontToken, email, customFields) { return { status: "error", code: patchRes.status, message: text }; } -// --------------------------------------------------------------------------- -// Slack notification (optional) -// --------------------------------------------------------------------------- - -async function notifySlack(webhookUrl, summary) { - if (!webhookUrl) return; - - const text = [ - `:arrows_counterclockwise: *Front ← Google Directory Sync Complete*`, - `• Updated: ${summary.updated}`, - `• Skipped (not in Front): ${summary.notInFront}`, - `• Skipped (no data): ${summary.noData}`, - `• Errors: ${summary.errors}`, - ]; - - if (summary.errorDetails.length > 0) { - text.push(""); - text.push("*Errors:*"); - summary.errorDetails.slice(0, 5).forEach((e) => { - text.push(` - \`${e.email}\`: ${e.message}`); - }); - } - - await fetch(webhookUrl, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ text: text.join("\n") }), - }); -} - // --------------------------------------------------------------------------- // Handler // --------------------------------------------------------------------------- @@ -314,9 +283,6 @@ exports.handler = async (event) => { console.log("Sync summary:", JSON.stringify(summary)); - // 5. Notify Slack - await notifySlack(process.env.SLACK_WEBHOOK_URL, summary); - return { statusCode: 200, body: summary,