moleculer-db
moleculer-db copied to clipboard
issue with #235
with default validator option strict "remove" , update params will be remove everything except id
pull #235
What's your suggestion?
update: {
rest: "PUT /:id",
params: {
- id: { type: "any" }
+ $$root: true,
+ type: 'object',
+ strict: false,
+ props: {
+ id: { type: "any" }
+ }
},
handler(ctx) {
Because I'm using default (fastest-validator), so I created this patch to fix problem, but I'm not sure with other validators. In general, I think this pull should be reverted
This suggestion works for you only, it's not a common solution. By the way, I think for your case, $$strict: false can be enough.