11<script setup lang="ts">
22import type { NewOperation } from ' ~/composables/useConnector'
3+ import { buildScopeTeam } from ' ~/utils/npm'
34
45const props = defineProps <{
56 orgName: string
@@ -103,7 +104,7 @@ async function loadTeamUsers(teamName: string) {
103104 isLoadingUsers .value [teamName ] = true
104105
105106 try {
106- const scopeTeam = ` ${ props .orgName }:${ teamName } `
107+ const scopeTeam = buildScopeTeam ( props .orgName , teamName )
107108 const result = await listTeamUsers (scopeTeam )
108109 if (result ) {
109110 teamUsers .value [teamName ] = result
@@ -135,7 +136,7 @@ async function handleCreateTeam() {
135136 isCreatingTeam .value = true
136137 try {
137138 const teamName = newTeamName .value .trim ()
138- const scopeTeam = ` ${ props .orgName }:${ teamName } `
139+ const scopeTeam = buildScopeTeam ( props .orgName , teamName )
139140 const operation: NewOperation = {
140141 type: ' team:create' ,
141142 params: { scopeTeam },
@@ -153,7 +154,7 @@ async function handleCreateTeam() {
153154
154155// Destroy team
155156async function handleDestroyTeam(teamName : string ) {
156- const scopeTeam = ` ${ props .orgName }:${ teamName } `
157+ const scopeTeam = buildScopeTeam ( props .orgName , teamName )
157158 const operation: NewOperation = {
158159 type: ' team:destroy' ,
159160 params: { scopeTeam },
@@ -171,7 +172,7 @@ async function handleAddUser(teamName: string) {
171172 isAddingUser .value = true
172173 try {
173174 const username = newUserUsername .value .trim ().replace (/ ^ @/ , ' ' )
174- const scopeTeam = ` ${ props .orgName }:${ teamName } `
175+ const scopeTeam = buildScopeTeam ( props .orgName , teamName )
175176
176177 let dependsOnId: string | undefined
177178
@@ -213,7 +214,7 @@ async function handleAddUser(teamName: string) {
213214
214215// Remove user from team
215216async function handleRemoveUser(teamName : string , username : string ) {
216- const scopeTeam = ` ${ props .orgName }:${ teamName } `
217+ const scopeTeam = buildScopeTeam ( props .orgName , teamName )
217218 const operation: NewOperation = {
218219 type: ' team:rm-user' ,
219220 params: { scopeTeam , user: username },
0 commit comments