Skip to content

Commit bb457cd

Browse files
committed
[internal] fix webhook id in response
1 parent edccb03 commit bb457cd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/sms-gateway/handlers/webhooks/3rdparty.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (h *ThirdPartyController) post(user models.User, c *fiber.Ctx) error {
8080
return fiber.NewError(fiber.StatusBadRequest, err.Error())
8181
}
8282

83-
if err := h.webhooksSvc.Replace(user.ID, *dto); err != nil {
83+
if err := h.webhooksSvc.Replace(user.ID, dto); err != nil {
8484
if webhooks.IsValidationError(err) {
8585
return fiber.NewError(fiber.StatusBadRequest, err.Error())
8686
}

internal/sms-gateway/modules/webhooks/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (s *Service) Select(userID string, filters ...SelectFilter) ([]smsgateway.W
6969

7070
// Replace creates or updates a webhook for a given user. After replacing the webhook,
7171
// it asynchronously notifies all the user's devices. Returns an error if the operation fails.
72-
func (s *Service) Replace(userID string, webhook smsgateway.Webhook) error {
72+
func (s *Service) Replace(userID string, webhook *smsgateway.Webhook) error {
7373
if !smsgateway.IsValidWebhookEvent(webhook.Event) {
7474
return newValidationError("event", webhook.Event, ErrInvalidEvent)
7575
}

0 commit comments

Comments
 (0)