useDeleteTeam
Overview
useDeleteTeam is a hook used to delete an existing team inside a project.
Usage
const Component = () => {
const team = {
_id: '662e760532df26ab0c1bf72a'
project: '662e783fa41e28e920f977c8'
name: 'example',
owner: '662e75cfe1570dec49e3faa6',
members: ['662e75da10664e8773e8fc8e','662e75e379f97b8bf9795316']
}
const { handleDeleteTeam } = useDeleteTeam()
return (
<Button
onClick={() => handleDeleteTeam({
projectId: team.project,
teamId: team._id
})}
>
Delete Team
</Button>
)
}
Parameters
No parameters are needed.
Returns
handleDeleteTeam
: A function that will open up a delete confirmation modal. If the user confirms, proceed to execute a delete mutation function. This function takesprojectId
andteamId
as parameters.