From 82a1b474755f19ca9e51e38be3e167aa33e5603f Mon Sep 17 00:00:00 2001 From: AyushRanjan Date: Wed, 13 Sep 2023 10:47:00 +0530 Subject: [PATCH] integration with backend done --- src/Pages/Team/partials/TeamForm.tsx | 32 +------------------------ src/components/MembersDetails/index.tsx | 6 ++++- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/src/Pages/Team/partials/TeamForm.tsx b/src/Pages/Team/partials/TeamForm.tsx index 7822fbe..a720dcf 100644 --- a/src/Pages/Team/partials/TeamForm.tsx +++ b/src/Pages/Team/partials/TeamForm.tsx @@ -19,36 +19,6 @@ import MembersDetails from '@src/components/MembersDetails'; import DrawerStyles from '@src/Pages/Incidents/DrawerMode/DrawerMode.module.scss'; import styles from '../Team.module.scss'; -const hardcodedData = { - data: { - id: 51, - name: 'DUMMY TEAM TESTING', - slackUserIds: ['U05KP1F523D', 'U05KRJ6RBHS'], - participants: [ - { - id: 'U05KP1F523D', - name: 'Vijay Joshi', - email: 'vijay.joshi@navi.com', - image: - 'https://avatars.slack-edge.com/2023-08-19/5770140728404_884eb71dcaf7d9e17f1e_32.jpg', - }, - { - id: 'U05KRJ6RBHS', - name: 'ayush ranjan', - email: 'ayush.ranjan@navi.com', - image: - 'https://secure.gravatar.com/avatar/373e7d55bcd66426441fa62eb82e1054.jpg?s=32\u0026d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0007-32.png', - }, - ], - lastUpdatedAt: '2023-09-12T12:12:34.19768Z', - webhookSlackChannelName: 'not found', - webhookSlackChannelId: '', - managerId: 'U05KP1F523D', - }, - error: {}, - status: 200, -}; - const TeamForm = (props: TeamFormProps) => { const { teamId, isExpanded, setTeamId, setLastUpdatedAt } = props; const [data, setData] = useState({}); @@ -183,7 +153,7 @@ const TeamForm = (props: TeamFormProps) => { Members: - + diff --git a/src/components/MembersDetails/index.tsx b/src/components/MembersDetails/index.tsx index 1e51bf7..ba7ced3 100644 --- a/src/components/MembersDetails/index.tsx +++ b/src/components/MembersDetails/index.tsx @@ -19,7 +19,8 @@ import { } from '@src/Pages/Team/constants'; const MembersDetails = (props: any) => { - const { data } = props; + //const { data } = props; + const { data, fetchTeamById } = props; const totalMembers = data?.participants?.length; const [showTotalMembers, setShowTotalMembers] = useState(10); const [showRemoveButton, setShowRemoveButton] = useState(false); @@ -31,6 +32,7 @@ const MembersDetails = (props: any) => { .then(response => { // Handle successful removal here, if needed toast.success(`${slackUserId} has been removed from team ${teamId}.`); + fetchTeamById(true); }) .catch(error => { // Handle error if the removal request fails @@ -47,6 +49,8 @@ const MembersDetails = (props: any) => { .then(response => { // Handle successful manager assignment here, if needed toast.success(`${slackUserId} is now a manager in team ${teamId}.`); + //const url=FETCH_SINGLE_TEAM_DATA(teamId); + fetchTeamById(true); }) .catch(error => { // Handle error if the manager assignment request fails