Skip to content

Commit

Permalink
fix: lightpush rest (#2176)
Browse files Browse the repository at this point in the history
* rest/lightpush/handlers.nim: enhance feedback in case of error.
* lightpush/openapi.yaml: fix typo in pubsubTopic field.
  • Loading branch information
Ivansete-status authored Nov 1, 2023
1 parent 52759fa commit fa467e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions waku/waku_api/rest/lightpush/handlers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ proc installLightPushRequestHandler*(
let req: PushRequest = decodedBody.value()

let msg = req.message.toWakuMessage().valueOr:
return RestApiResponse.badRequest("Invalid message: {msg.error}")
return RestApiResponse.badRequest("Invalid message: " & $error)

let peer = node.peerManager.selectPeer(WakuLightPushCodec).valueOr:
let handler = discHandler.valueOr:
return NoPeerNoDiscoError

let peerOp = (await handler()).valueOr:
return RestApiResponse.internalServerError($error)
return RestApiResponse.internalServerError("No value in peerOp: " & $error)

peerOp.valueOr:
return NoPeerNoneFoundError
Expand Down
2 changes: 1 addition & 1 deletion waku/waku_api/rest/lightpush/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ components:
PushRequest:
type: object
properties:
pusbsubTopic:
pubsubTopic:
$ref: '#/components/schemas/PubsubTopic'
message:
$ref: '#/components/schemas/WakuMessage'
Expand Down

0 comments on commit fa467e2

Please sign in to comment.