import { UserSession } from "@esri/arcgis-rest-auth" ; import { removeGroup , unprotectGroup } from "@esri/arcgis-rest-portal" ; export param { string } id param { UserSession } authentication return { * } export async function removeTeam ( id , authentication ) { const unprotectResult = await unprotectGroup ( { id , authentication } ) ; return unprotectResult . success ? removeGroup ( { id , authentication } ) : { groupId : id , success : false } ; }