Skip to content

Commit 7d2bf77

Browse files
CopilotZacgoose
andcommitted
Simplify includeAllTenants boolean logic
Co-authored-by: Zacgoose <[email protected]>
1 parent e9b3495 commit 7d2bf77

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ListNewUserDefaults.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ function Invoke-ListNewUserDefaults {
1515
Write-Host "TenantFilter from request: $TenantFilter"
1616

1717
# Get the includeAllTenants flag from query or body parameters (defaults to true)
18-
$IncludeAllTenants = if ($null -ne $Request.Query.includeAllTenants) {
19-
[System.Convert]::ToBoolean($Request.Query.includeAllTenants)
20-
} elseif ($null -ne $Request.Body.includeAllTenants) {
21-
[System.Convert]::ToBoolean($Request.Body.includeAllTenants)
18+
$IncludeAllTenants = if ($Request.Query.includeAllTenants -eq $false -or $Request.Body.includeAllTenants -eq $false) {
19+
$false
2220
} else {
23-
$true # Default to including AllTenants templates
21+
$true
2422
}
2523
Write-Host "IncludeAllTenants: $IncludeAllTenants"
2624

0 commit comments

Comments
 (0)