Skip to content

Commit 4038748

Browse files
committed
support frontend tenant selector for adding
1 parent 496632e commit 4038748

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Spamfilter/Invoke-AddTenantAllowBlockList.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ function Invoke-AddTenantAllowBlockList {
1212
$Headers = $Request.Headers
1313

1414
$BlockListObject = $Request.Body
15-
if ($Request.Body.tenantID -eq 'AllTenants') { $Tenants = (Get-Tenants).defaultDomainName } else { $Tenants = @($Request.body.tenantID) }
15+
$TenantID = $Request.Body.tenantID.value ?? $Request.Body.tenantID
16+
17+
if ($TenantID -eq 'AllTenants') {
18+
$Tenants = (Get-Tenants).defaultDomainName
19+
} elseif ($TenantID -is [array]) {
20+
$Tenants = $TenantID
21+
} else {
22+
$Tenants = @($TenantID)
23+
}
1624
$Results = [System.Collections.Generic.List[string]]::new()
1725
$Entries = @()
1826
if ($BlockListObject.entries -is [array]) {

0 commit comments

Comments
 (0)