[Resource] Validation Middleware #229
Atlinx
started this conversation in
Show and tell
Replies: 1 comment
-
When we add it to the default middlewares of typetta it will need some typing, but it looks cool! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If anyone needs validation middleware for their fields that runs before a modifying operation, here's one I made:
validation.middleware.ts
This middleware listens for any operation that modifies an entity (update, create, or replace). Some caveats are that this isn't typed, because I'm not sure how to get generics working with something like this. It'll be easy to add types once we get shorthands #224 though.
Use
Single configuration
Multiple options, merged together
Beta Was this translation helpful? Give feedback.
All reactions