From e2900026ba4116f8b7f6652e8dcf69d47648edcc Mon Sep 17 00:00:00 2001 From: Mohamed Amine ALOUINI <32941812+alouini333@users.noreply.github.com> Date: Mon, 2 Oct 2023 00:15:06 +0200 Subject: [PATCH] docs(pipes): update wording --- content/pipes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pipes.md b/content/pipes.md index fdae4f4446..fb68876a9e 100644 --- a/content/pipes.md +++ b/content/pipes.md @@ -218,7 +218,7 @@ export class CreateCatDto { } ``` -We want to ensure that any incoming request to the create method contains a valid body. So we have to validate the three members of the `createCatDto` object. We could do this inside the route handler method, but doing so is not ideal as it would break the **single responsibility rule** (SRP). +We want to ensure that any incoming request to the create method contains a valid body. So we have to validate the three members of the `createCatDto` object. We could do this inside the route handler method, but doing so is not ideal as it would break the **single responsibility principle** (SRP). Another approach could be to create a **validator class** and delegate the task there. This has the disadvantage that we would have to remember to call this validator at the beginning of each method.