Skip to content

Commit c4a26fc

Browse files
committed
adds one more check
1 parent 6efd6e8 commit c4a26fc

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

app/Listeners/CheckoutableListener.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ public function onCheckedOut($event)
102102
$message = $this->getCheckoutNotification($event)->toMicrosoftTeams();
103103
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
104104
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
105-
} else {
106-
107-
Notification::route($this->webhookSelected(), Setting::getSettings()->webhook_endpoint)
108-
->notify($this->getCheckoutNotification($event, $acceptance));
109105
}
110106
}
111107
} catch (ClientException $e) {
@@ -196,12 +192,12 @@ public function onCheckedIn($event)
196192
try {
197193
if ($this->shouldSendWebhookNotification()) {
198194
if ($this->newMicrosoftTeamsWebhookEnabled()) {
195+
if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){
196+
return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail'));
197+
}
199198
$message = $this->getCheckinNotification($event)->toMicrosoftTeams();
200199
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
201200
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
202-
} else {
203-
Notification::route($this->webhookSelected(), Setting::getSettings()->webhook_endpoint)
204-
->notify($this->getCheckinNotification($event));
205201
}
206202
}
207203
} catch (ClientException $e) {

0 commit comments

Comments
 (0)