fix: Workspace error handler creation was not adding the slack resource (#2733)

Co-authored-by: admin <admin@windmill.dev>
This commit is contained in:
Guillaume Bouvignies
2023-11-30 12:20:32 +01:00
committed by GitHub
parent 0d93986b18
commit 70c504edfa
@@ -224,6 +224,9 @@
async function editErrorHandler() {
if (errorHandlerScriptPath) {
if (errorHandlerScriptPath !== undefined && isSlackHandler(errorHandlerScriptPath)) {
errorHandlerExtraArgs['slack'] = '$res:f/slack_bot/bot_token'
}
await WorkspaceService.editErrorHandler({
workspace: $workspaceStore!,
requestBody: {
@@ -245,6 +248,13 @@
sendUserToast(`workspace error handler removed`)
}
}
function isSlackHandler(scriptPath: string) {
return (
scriptPath.startsWith('hub/') &&
scriptPath.endsWith('/workspace-or-schedule-error-handler-slack')
)
}
</script>
<CenteredPage>