-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
d6b397e
commit 02f2460
Showing
3 changed files
with
114 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { App } from '@slack/bolt'; | ||
import BlockfrostInstallationStore from '../installation-store/index.js'; | ||
import { logger } from '../utils/logger.js'; | ||
import { StringIndexed } from '@slack/bolt/dist/types/helpers.js'; | ||
|
||
export const registerAppUninstalledEvent = (app: App<StringIndexed>) => { | ||
app.event('app_uninstalled', async ({ context }) => { | ||
try { | ||
const store = new BlockfrostInstallationStore({ logger: logger }); | ||
|
||
await store.deleteInstallation({ | ||
teamId: context.teamId, | ||
enterpriseId: context.enterpriseId, | ||
isEnterpriseInstall: context.isEnterpriseInstall, | ||
}); | ||
} catch (error) { | ||
logger.error(error); | ||
} | ||
}); | ||
}; |