Home > Mobile >  Return variable from @Patch @Delete located in url - #${id}. Lesson 12 in NestJS course
Return variable from @Patch @Delete located in url - #${id}. Lesson 12 in NestJS course

Time:11-05

enter image description here

I'm at the very beggining of NestJS course. Insomnia and localhost seem to work well. On @Get request there is no problem to return a simple message, but for example in @Patch or @Delete decorator, when the tutorial says to return lorem ipsum #${id} where ${id} should be localhost:3000/coffes/726 and just return "lorem ipsum 726" it returns it not finding the variable.

return "lorem ipsum #${id}" returns return "lorem ipsum #${id} instead of return "lorem ipsum 726

CodePudding user response:

I think you should return this message, because the id isn't parsed in your expression :

return `this action updates ${id}` 

check out the documentation for more informations

  • Related