mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: a push notification is not chat
This commit is contained in:
@@ -177,8 +177,18 @@ class WatchListController extends AbstractController
|
||||
/** @var AbstractTransportFactory $transportFactory */
|
||||
$transportFactory = new $transportFactoryClass();
|
||||
|
||||
$push = (new TestChatNotification())->asPushMessage();
|
||||
$chat = (new TestChatNotification())->asChatMessage();
|
||||
|
||||
try {
|
||||
$transportFactory->create($dsn)->send((new TestChatNotification())->asChatMessage());
|
||||
$factory = $transportFactory->create($dsn);
|
||||
if ($factory->supports($push)) {
|
||||
$factory->send($push);
|
||||
} elseif ($factory->supports($chat)) {
|
||||
$factory->send($chat);
|
||||
} else {
|
||||
throw new BadRequestHttpException('Unsupported message type');
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
throw new BadRequestHttpException($exception->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user