casing fixed
This commit is contained in:
@@ -14,13 +14,6 @@
|
||||
.participant-detail-nest {
|
||||
display: flex;
|
||||
}
|
||||
.participant-detail-nest:hover .mark-as-manager {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mark-as-manager {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.remove-logo {
|
||||
cursor: pointer;
|
||||
|
||||
@@ -28,6 +28,7 @@ const MembersDetails = (props: any) => {
|
||||
const [selectedParticipantId, setSelectedParticipantId] = useState('0');
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [isShowMore, setIsShowMore] = useState<boolean>(false);
|
||||
const [selectedParticipantName, setSelectedParticipantName] = useState('0');
|
||||
|
||||
const fetchSingleTeamData = teamId => {
|
||||
const fetchTeamDataEndpoint = FETCH_SINGLE_TEAM_DATA(teamId);
|
||||
@@ -52,12 +53,12 @@ const MembersDetails = (props: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleRemoveUser = (teamId, slackUserId) => {
|
||||
const handleRemoveUser = (teamId, slackUserId, participantName) => {
|
||||
const endpoint = REMOVE_TEAM_MEMBER(teamId, slackUserId);
|
||||
ApiService.delete(endpoint)
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
toast.success(response.data.data);
|
||||
toast.success(`${participantName} was removed from the team`);
|
||||
setIsLoading(true);
|
||||
setData([]);
|
||||
fetchSingleTeamData(teamId);
|
||||
@@ -66,9 +67,7 @@ const MembersDetails = (props: any) => {
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
toast.error(
|
||||
`Error removing ${slackUserId} from team ${teamId}: ${error.message}`,
|
||||
);
|
||||
toast.error(`Error removing member from team : ${error.message}`);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -78,7 +77,9 @@ const MembersDetails = (props: any) => {
|
||||
ApiService.patch(endpoint, {})
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
toast.success(response.data.data);
|
||||
toast.success(
|
||||
`Team manager has been successfully updated to ${selectedParticipantName}`,
|
||||
);
|
||||
setIsLoading(true);
|
||||
setData([]);
|
||||
fetchSingleTeamData(teamId);
|
||||
@@ -87,14 +88,13 @@ const MembersDetails = (props: any) => {
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
toast.error(
|
||||
`Error making ${slackUserId} a manager in team ${teamId}: ${error.message}`,
|
||||
);
|
||||
toast.error(`Error in making manager of team : ${error.message}`);
|
||||
});
|
||||
};
|
||||
|
||||
const handleOpenModal = participantId => {
|
||||
const handleOpenModal = (participantId, participantName) => {
|
||||
setSelectedParticipantId(participantId);
|
||||
setSelectedParticipantName(participantName);
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
@@ -178,7 +178,10 @@ const MembersDetails = (props: any) => {
|
||||
>
|
||||
<PersonIcon
|
||||
onClick={() => {
|
||||
handleOpenModal(participant.id);
|
||||
handleOpenModal(
|
||||
participant.id,
|
||||
participant.name,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<ModalDialog
|
||||
@@ -222,7 +225,11 @@ const MembersDetails = (props: any) => {
|
||||
<Tooltip position="top" text="Remove Member">
|
||||
<CloseIcon
|
||||
onClick={() => {
|
||||
handleRemoveUser(data.id, participant.id);
|
||||
handleRemoveUser(
|
||||
data.id,
|
||||
participant.id,
|
||||
participant.name,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
|
||||
Reference in New Issue
Block a user