From 64afab2db3018477fdade8516be2f02d48bf845f Mon Sep 17 00:00:00 2001 From: Juliano Maia Date: Thu, 16 Feb 2023 22:50:30 -0300 Subject: [PATCH 1/2] docs: fix docs examples --- website/docs/basics.md | 2 +- website/docs/validation.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/basics.md b/website/docs/basics.md index 9a464ba7..447b9636 100644 --- a/website/docs/basics.md +++ b/website/docs/basics.md @@ -192,7 +192,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => { However, with `next-api-decorators` you can write the same handler in a declarative manner: ```ts -import { createHandler, Body, Get, HttpCode, NotFoundException, Post, Query } from 'next-api-decorators'; +import { createHandler, Body, Get, HttpCode, NotFoundException, Post, Query, ValidationPipe } from 'next-api-decorators'; class User { // GET /api/user diff --git a/website/docs/validation.md b/website/docs/validation.md index 503bea8c..d724f5b4 100644 --- a/website/docs/validation.md +++ b/website/docs/validation.md @@ -79,8 +79,8 @@ class LocationHandler { @Post() saveLocation(@Body(ValidationPipe) body: MapMarker) { // Do something with the data. - return `Location "${body.label}" saved.'; - } + return `Location "${body.label}" saved.`; + } export default createHandler(LocationHandler); From 057471c249f4a9743dd11a42efa16aa6386a648b Mon Sep 17 00:00:00 2001 From: Juliano Maia Date: Sat, 25 Feb 2023 15:43:15 -0300 Subject: [PATCH 2/2] Update website/docs/validation.md Co-authored-by: Doeke Leeuwis --- website/docs/validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/validation.md b/website/docs/validation.md index d724f5b4..b0518f44 100644 --- a/website/docs/validation.md +++ b/website/docs/validation.md @@ -80,7 +80,7 @@ class LocationHandler { saveLocation(@Body(ValidationPipe) body: MapMarker) { // Do something with the data. return `Location "${body.label}" saved.`; - + } } export default createHandler(LocationHandler);