@@ -28,10 +28,13 @@ import AddTeamModal from '@/components/teams/AddTeamModal.vue'
2828import { TeamService , type TeamWithRole } from ' @/services/teamService'
2929import { UserService } from ' @/services/userService'
3030import { createColumns } from ' ./teams/columns'
31- import { useRouter } from ' vue-router'
31+ import { useRouter , useRoute } from ' vue-router'
32+ import { Alert , AlertDescription } from ' @/components/ui/alert'
33+ import { CheckCircle } from ' lucide-vue-next'
3234
3335const { t } = useI18n ()
3436const router = useRouter ()
37+ const route = useRoute ()
3538
3639// State
3740const teams = ref <TeamWithRole []>([])
@@ -44,6 +47,7 @@ const rowSelection = ref({})
4447const showAddModal = ref (false )
4548const canCreateTeams = ref (false )
4649const userPermissions = ref <string []>([])
50+ const deleteSuccessMessage = ref <string | null >(null )
4751
4852// Handle manage team navigation
4953const handleManageTeam = (teamId : string ) => {
@@ -89,8 +93,27 @@ const handleTeamCreated = async () => {
8993 await TeamService .getUserTeams (true )
9094}
9195
96+ // Check for delete success message from query params
97+ const checkDeleteSuccess = () => {
98+ const deletedTeamName = route .query .deleted as string
99+ if (deletedTeamName ) {
100+ deleteSuccessMessage .value = t (' teams.messages.deleteSuccess' , { teamName: deletedTeamName })
101+
102+ // Clear the query parameter from URL
103+ router .replace ({ path: ' /teams' })
104+
105+ // Clear the message after 5 seconds
106+ setTimeout (() => {
107+ deleteSuccessMessage .value = null
108+ }, 5000 )
109+ }
110+ }
111+
92112// Load data on component mount
93113onMounted (async () => {
114+ // Check for delete success message first
115+ checkDeleteSuccess ()
116+
94117 await Promise .all ([
95118 checkPermissions (),
96119 fetchTeams ()
@@ -170,6 +193,12 @@ const filterValue = computed({
170193 </Button >
171194 </div >
172195
196+ <!-- Delete Success Message -->
197+ <Alert v-if =" deleteSuccessMessage" class =" border-green-200 bg-green-50 text-green-800" >
198+ <CheckCircle class =" h-4 w-4" />
199+ <AlertDescription >{{ deleteSuccessMessage }}</AlertDescription >
200+ </Alert >
201+
173202 <!-- Loading State -->
174203 <div v-if =" isLoading" class =" text-muted-foreground" >
175204 {{ t('teams.table.loading') }}
0 commit comments