diff --git a/src/Pages/Team/partials/TeamForm.tsx b/src/Pages/Team/partials/TeamForm.tsx index 6758846..9bfc625 100644 --- a/src/Pages/Team/partials/TeamForm.tsx +++ b/src/Pages/Team/partials/TeamForm.tsx @@ -20,6 +20,7 @@ const TeamForm = (props: TeamFormProps) => { const [data, setData] = useState({}); const [slackUserIds, setSlackUserIds] = useState(''); const [isLoading, setIsLoading] = useState(false); + const [slackChannelId, setSlackChannelId] = useState(''); const fetchTeamById = (updateDate = false) => { const endPoint = FETCH_SINGLE_TEAM_DATA(teamId); @@ -61,6 +62,7 @@ const TeamForm = (props: TeamFormProps) => { workEmailIds: slackUserIds?.includes(',') ? slackUserIds.split(',').map(item => item?.trim()) : [slackUserIds], + webhook_slack_channel: slackChannelId, }) .then(response => { toast.success('Team Updated Successfully !!'); @@ -76,6 +78,13 @@ const TeamForm = (props: TeamFormProps) => { }); }; + const getSubmitButtonState = (): boolean => { + if (slackUserIds.length) { + return !slackUserIds.length; + } + return !slackChannelId.length; + }; + if (isLoading) { return (
@@ -88,6 +97,14 @@ const TeamForm = (props: TeamFormProps) => { <>
+
+ + Slack Channel Name + + + {data?.webhook_slack_channel_name || '-'} + +
Members @@ -107,13 +124,23 @@ const TeamForm = (props: TeamFormProps) => { fullWidth />
+
+ setSlackChannelId(e.target?.value)} + hintMsg="Add the slack channel to get incident updates." + fullWidth + /> +