Skip to content

Commit 2b36e2d

Browse files
committed
[webhooks] improve device id validation error message
1 parent 9559cc9 commit 2b36e2d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (s *Service) Replace(userID string, webhook smsgateway.Webhook) error {
8282
return fmt.Errorf("failed to select devices: %w", err)
8383
}
8484
if !ok {
85-
return devices.ErrNotFound
85+
return newValidationError("device_id", *webhook.DeviceID, devices.ErrNotFound)
8686
}
8787
}
8888

pkg/swagger/docs/requests.http

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Content-Type: application/json
9090

9191
{
9292
"id": "MYofX8bTd5Bov0wWFZLRP",
93+
"deviceId": "C0ZGtCNf7-sXTbCtF6JXm",
9394
"url": "https://webhook.site/280a6655-eb68-40b9-b857-af5be37c5303",
9495
"event": "sms:received"
9596
}

0 commit comments

Comments
 (0)