Skip to content

Commit 003a5e8

Browse files
sukhwinder33445nilmerg
authored andcommitted
IncidentDetail: Don't show deleted contacts in subscribers list
1 parent 4ce30be commit 003a5e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/Notifications/Widget/Detail/IncidentDetail.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use ipl\Html\HtmlElement;
1616
use ipl\Html\Table;
1717
use ipl\Html\Text;
18+
use ipl\Stdlib\Filter;
1819

1920
class IncidentDetail extends BaseHtmlElement
2021
{
@@ -36,7 +37,12 @@ public function __construct(Incident $incident)
3637
protected function createContacts()
3738
{
3839
$contacts = [];
39-
foreach ($this->incident->incident_contact->with('contact')->orderBy('role', SORT_DESC) as $incident_contact) {
40+
$query = $this->incident->incident_contact
41+
->with('contact')
42+
->filter(Filter::equal('contact.deleted', 'n'))
43+
->orderBy('role', SORT_DESC);
44+
45+
foreach ($query as $incident_contact) {
4046
$contact = $incident_contact->contact;
4147
$contact->role = $incident_contact->role;
4248

0 commit comments

Comments
 (0)