balderdashy / balderdashy/sails
How to prevent insert of data that is passed using query string in sails.js for post request?
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
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???**
1. Post data using query string in post request => working fine

2. Post data using request.body in post request => **working fine (I want to insert data using this way only)**

Contributor guide
Research direction
Start with the Sails model and controller that provide the generated POST endpoint, then review how request.body and the query string are handled. Reproduce both requests against the MySQL-backed model and confirm that values from request.body are persisted without query-string data being inserted or taking precedence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql
- Domain
- api, backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100