Skip to content

Commit 4b6aa7c

Browse files
remove forever as an option
1 parent a85ec47 commit 4b6aa7c

3 files changed

Lines changed: 18 additions & 19 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecSnoozeAlert.ps1

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ function Invoke-ExecSnoozeAlert {
2222

2323
if ([string]::IsNullOrWhiteSpace($CmdletName) -or [string]::IsNullOrWhiteSpace($TenantFilter) -or $null -eq $AlertItem) {
2424
return ([HttpResponseContext]@{
25-
StatusCode = [HttpStatusCode]::BadRequest
26-
Body = @{ Results = 'CmdletName, TenantFilter, and AlertItem are required.' }
27-
})
25+
StatusCode = [HttpStatusCode]::BadRequest
26+
Body = @{ Results = 'CmdletName, TenantFilter, and AlertItem are required.' }
27+
})
2828
}
2929

3030
if ($Duration -notin @(7, 14, 30, -1)) {
3131
return ([HttpResponseContext]@{
32-
StatusCode = [HttpStatusCode]::BadRequest
33-
Body = @{ Results = 'Duration must be 7, 14, 30, or -1 (forever).' }
34-
})
32+
StatusCode = [HttpStatusCode]::BadRequest
33+
Body = @{ Results = 'Duration must be 7, 14, 30, or -1 (forever).' }
34+
})
3535
}
3636

3737
# Compute content hash for this alert item
@@ -67,20 +67,20 @@ function Invoke-ExecSnoozeAlert {
6767
Write-LogMessage -headers $Headers -API $APIName -message $Result -Sev 'Info' -tenant $TenantFilter
6868

6969
return ([HttpResponseContext]@{
70-
StatusCode = [HttpStatusCode]::OK
71-
Body = @{
72-
Results = $Result
73-
ContentHash = $HashResult.ContentHash
74-
SnoozeUntil = $SnoozeUntil
75-
SnoozedBy = $SnoozedBy
76-
}
77-
})
70+
StatusCode = [HttpStatusCode]::OK
71+
Body = @{
72+
Results = $Result
73+
ContentHash = $HashResult.ContentHash
74+
SnoozeUntil = $SnoozeUntil
75+
SnoozedBy = $SnoozedBy
76+
}
77+
})
7878
} catch {
7979
$ErrorMessage = Get-CippException -Exception $_
8080
Write-LogMessage -headers $Headers -API $APIName -message "Failed to snooze alert: $($ErrorMessage.NormalizedError)" -Sev 'Error' -tenant $TenantFilter
8181
return ([HttpResponseContext]@{
82-
StatusCode = [HttpStatusCode]::InternalServerError
83-
Body = @{ Results = "Failed to snooze alert: $($ErrorMessage.NormalizedError)" }
84-
})
82+
StatusCode = [HttpStatusCode]::InternalServerError
83+
Body = @{ Results = "Failed to snooze alert: $($ErrorMessage.NormalizedError)" }
84+
})
8585
}
8686
}

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListSnoozedAlerts.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ function Invoke-ListSnoozedAlerts {
4343
SnoozedBy = $_.SnoozedBy
4444
SnoozedAt = $_.SnoozedAt
4545
SnoozeUntil = $_.SnoozeUntil
46-
IsForever = $IsForever
4746
IsExpired = $IsExpired
4847
RemainingDays = $RemainingDays
4948
Status = if ($IsForever) { 'Forever' } elseif ($IsExpired) { 'Expired' } else { 'Active' }

Modules/CIPPCore/Public/Send-CIPPScheduledTaskAlert.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function Send-CIPPScheduledTaskAlert {
9292
<td style="padding:0 6px 0 0;"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#0078d4;padding:6px 14px;"><a href="${BaseLink}&duration=7" style="color:#ffffff;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;">7 Days</a></td></tr></table></td>
9393
<td style="padding:0 6px 0 0;"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#0078d4;padding:6px 14px;"><a href="${BaseLink}&duration=14" style="color:#ffffff;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;">14 Days</a></td></tr></table></td>
9494
<td style="padding:0 6px 0 0;"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#ff9800;padding:6px 14px;"><a href="${BaseLink}&duration=30" style="color:#ffffff;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;">30 Days</a></td></tr></table></td>
95-
<td style="padding:0;"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#d32f2f;padding:6px 14px;"><a href="${BaseLink}&duration=-1" style="color:#ffffff;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;">Forever</a></td></tr></table></td>
95+
<td style="padding:0;"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#d32f2f;padding:6px 14px;"><a href="${BaseLink}&duration=90" style="color:#ffffff;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;">90 Days</a></td></tr></table></td>
9696
</tr></table>
9797
</td></tr>
9898
</table>

0 commit comments

Comments
 (0)