-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,626 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...ackend/src/prisma/migrations/20240910005616_add_logo_image_featured_project/migration.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...c/prisma/migrations/20240911164338_changed_logo_image_name_to_logo_image_id/migration.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import express from 'express'; | ||
import slackController from '../controllers/slack.controllers'; | ||
import { createEventAdapter } from '@slack/events-api'; | ||
import slackServices from '../services/slack.services'; | ||
import OrganizationsService from '../services/organizations.services'; | ||
import { getWorkspaceId } from '../integrations/slack'; | ||
|
||
const slackRouter = express.Router(); | ||
export const slackEvents = createEventAdapter(process.env.SLACK_SIGNING_SECRET || ''); | ||
|
||
slackRouter.post('/', slackController.handleEvent); | ||
slackEvents.on('message', async (event) => { | ||
const organizations = await OrganizationsService.getAllOrganizations(); | ||
const nerSlackWorkspaceId = await getWorkspaceId(); | ||
const orgId = organizations.find((org) => org.slackWorkspaceId === nerSlackWorkspaceId)?.organizationId; | ||
if (orgId) { | ||
slackServices.processMessageSent(event, orgId); | ||
} | ||
}); | ||
|
||
export default slackRouter; | ||
slackEvents.on('error', (error) => { | ||
console.log(error.name); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.