File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -755,8 +755,8 @@ export async function createM365Group(
755755 const groupName = `${ displayName } ${ groupSuffix } ` ;
756756
757757 try {
758- // First, check if a group with this mail nickname already exists
759- const checkUrl = `https://graph.microsoft.com/v1.0/groups?$filter=displayName eq '${ encodeURIComponent ( groupName ) } '` ;
758+ // Check if a group with this mail nickname already exists
759+ const checkUrl = `https://graph.microsoft.com/v1.0/groups?$filter=mailNickname eq '${ encodeURIComponent ( safeMailNickname ) } '` ;
760760 const checkResponse = await fetch ( checkUrl , {
761761 method : "GET" ,
762762 headers : {
@@ -787,7 +787,7 @@ export async function createM365Group(
787787 return existingGroup . id ;
788788 }
789789 throw new EntraGroupError ( {
790- message : `A group with name '${ groupName } ' already exists but is not a Microsoft 365 group.` ,
790+ message : `A group with mailNickname '${ safeMailNickname } ' already exists but is not a Microsoft 365 group.` ,
791791 group : groupName ,
792792 } ) ;
793793 }
You can’t perform that action at this time.
0 commit comments