Skip to content

Commit

Permalink
management-service: Fix discord messages issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Woojciech authored and XxRoloxX committed Dec 3, 2024
1 parent 139c50e commit cc086b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public class DiscordNotificationService implements ReportNotifier {

public void sendTestMessage(Long receiverDiscordId) {
var receiver = discordReceiverService.getDiscordReceiver(receiverDiscordId);
String decodedWebhookUrl = confidentialTextEncoder.decrypt(receiver.getWebhookUrl());
sendTestMessage(decodedWebhookUrl);
sendTestMessage(receiver.getWebhookUrl());
}

private void sendTestMessage(String webhookUrl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class DiscordReceiverDTO {
@Size(min = 2, max = 100, message = "The discord integration name must be from 2 to 100 characters.")
private String name;
@NotBlank(message = "Webhook url cannot be empty")
@Pattern(regexp = "https://discord.com/api/webhooks/[0-9]+/[a-zA-Z0-9\\-]+", message = "Provided webhook url is invalid")
@Pattern(regexp = "https://discord.com/api/webhooks/[0-9]+/[a-zA-Z0-9\\-_]+", message = "Provided webhook url is invalid")
private String webhookUrl;
}

0 comments on commit cc086b4

Please sign in to comment.