Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric committed Apr 5, 2024
1 parent 1c7ecb6 commit 144558b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions connectors/src/api/webhooks/webhook_slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,18 @@ const _webhookSlackAPIHandler = async (
slackTeamId: teamId,
});

const slackConfigurations = teamId
? await SlackConfigurationResource.listForTeamId(teamId)
: [];
if (!teamId) {
return apiError(req, res, {
api_error: {
type: "invalid_request_error",
message: "Missing team_id in request body",
},
status_code: 400,
});
}
const slackConfigurations = await SlackConfigurationResource.listForTeamId(
teamId
);
if (slackConfigurations.length === 0) {
return apiError(req, res, {
api_error: {
Expand Down

0 comments on commit 144558b

Please sign in to comment.