Skip to content

Commit

Permalink
docs(pipes): update wording
Browse files Browse the repository at this point in the history
  • Loading branch information
alouini333 authored Oct 1, 2023
1 parent a53ab1e commit e290002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/pipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit e290002

Please sign in to comment.