I have created new table in mysql also created model and controller in sails.js. Now I am trying to insert data using sails. As we know when we create new modal in sails it will create new post, get and other api for us by default.
Now I am trying to insert data using post api using query string and request.body and both are working But I need to insert data into db that is passed using request.body instead of request.querystring data in post request. How can I do it???
- Post data using query string in post request => working fine
Post data using request.body in post request => working fine (I want to insert data using this way only)
Same question I asked here https://gitter.im/balderdashy/sails and https://github.com/balderdashy/sails/issues/6918
sails uses Waterline, this performs sanitation by itself, you should be fine whenever you are using some of this built-in model methods:
As an extra layer of security you can check that the providing data types are correct and verify range, characters, etc. There are also policies which allow you to restrict certain actions to logged-in users only.
hope this was helpful :)