Skip to content

Route not found if the decorator is put before the @POST route #4

@vladiulianbogdan

Description

@vladiulianbogdan

Hello,

First of all, thank you for your work on this library!

I've included this library in my project and what I have noticed is that if I put the lock decorator before the @post on a route, the route becomes unavailable and the client gets 404. Example:

  @Authenticated()
  @RedisLock((target, req) => IntegrationController.lockingKey(req.user.id), IntegrationController.lockTimeout)
  @Post('/test')
  async testRoute(@Request() req, @Query() { providerId, step, debug }: FlowQuery, @Body() { data, assetDetails }: FlowRequestBody) {

If I do like in the code above I get 404. However, if I do it like in the code below it works properly.

  @Authenticated()
  @Post('/test')
  @RedisLock((target, req) => IntegrationController.lockingKey(req.user.id), IntegrationController.lockTimeout)
  async testRoute(@Request() req, @Query() { providerId, step, debug }: FlowQuery, @Body() { data, assetDetails }: FlowRequestBody) {

I want to ask you if this is normal or not and if it is why does it happen?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions