-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-139] Error handling and checks on creation #80
[WEB-139] Error handling and checks on creation #80
Conversation
WEB-139 Slack integration can't be added to an existing channel
Error:
|
users: user.slack_user_id, | ||
}); | ||
// Check if channel exists from previous API calls | ||
if (channel_info?.ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn’t the API client throw an error, instead of returning a non-ok response object?
Change thrown errors to returned messages that will get displayed properly to the client.
components/SlackChannelField.tsx
Outdated
@@ -37,6 +38,11 @@ export default function SlackChannelField(props: { parentName: string }) { | |||
|
|||
return ( | |||
<> | |||
{ctx.formState.errors.slack_channel && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use props.parentName
somehow?
components/SlackChannelField.tsx
Outdated
@@ -38,13 +38,13 @@ export default function SlackChannelField(props: { parentName: string }) { | |||
|
|||
return ( | |||
<> | |||
{ctx.formState.errors.slack_channel && ( | |||
{ctx.formState.errors[`${props.parentName}`] && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: this can just be formState.errors[props.parentName]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Added some Error handling and other various checks before channel creation / channel join / channel invite