Closed neophylon closed 5 years ago
$.model
is only available in methods where it make sense, such as setInsert, setUpdate, setSave
Also $.model
is validated against the schema defined properties and in the setQuery
you don't need that.
In your case the data you send to your server is more like a filter and it has nothing to do with the model.
So using $.body['type']
is the right way to go.
Thank you advise.
I have got a problem call $.model in schema. my souce is following . and I use postman url : http://localhost/api/v3/test method : post body : { "size" : 10, "page" :1, "type":"body", "section":"stand" } I can't figure out this problem.
controller/api.js
schemas/api.js
error message
==> I can't use $.model in schema.setQuery function, but $.body['type'] is work. in schema.setQuery console.log($.mode['type']) : undefined type console.log($.body['type']) : body