Skip to content

Commit aec50f2

Browse files
-
1 parent 547807e commit aec50f2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Controller/AppSubscriptionsController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ public function test(Request $request, string $id): JsonResponse
207207

208208
$notification = new AppNotificationModel();
209209
$notification->setType(AppNotificationModel::TYPE_CLUSTER_HEALTH);
210-
$notification->setTitle($this->clusterHealth['cluster_name'].': health');
211-
$notification->setBody(ucfirst($this->clusterHealth['status']));
210+
$notification->setCluster($this->clusterHealth['cluster_name']);
211+
$notification->setTitle('health');
212+
$notification->setContent(ucfirst($this->clusterHealth['status']));
212213
$notification->setColor($this->clusterHealth['status']);
213214

214215
switch ($subscription->getType()) {
@@ -231,7 +232,7 @@ public function test(Request $request, string $id): JsonResponse
231232
$payload = [
232233
'tag' => uniqid('', true),
233234
'title' => $notification->getSubject(),
234-
'body' => $notification->getBody(),
235+
'body' => $notification->getContent(),
235236
];
236237

237238
$subcription = Subscription::create([

tests/Model/AppNotificationModelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ public function test()
1111
{
1212
$notification = new AppNotificationModel();
1313
$notification->setTitle('title');
14-
$notification->setBody('body');
14+
$notification->setContent('content');
1515
$notification->setColor('color');
1616

1717
$this->assertEquals($notification->getTitle(), 'title');
18-
$this->assertEquals($notification->getBody(), 'body');
18+
$this->assertEquals($notification->getContent(), 'content');
1919
$this->assertEquals($notification->getColor(), 'color');
2020
}
2121
}

0 commit comments

Comments
 (0)