fix(api): webhooks should only listen on correct events

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-03 09:22:00 +02:00
parent e5605745de
commit 761b64d248
2 changed files with 36 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import type { WebhookEvent } from '@clerk/fastify';
import { setSuperJson } from '@openpanel/common';
import { AccessLevel, db } from '@openpanel/db';
import {
sendSlackNotification,
@@ -242,7 +243,12 @@ export async function slackWebhook(
},
});
getRedisPub().publish('integrations:slack', 'ok');
getRedisPub().publish(
'integrations:slack',
setSuperJson({
organizationId: parsedMetadata.data.organizationId,
}),
);
reply.send({ success: true });
} catch (err) {