We can use
'PATCH /companies/:id' : 'CompanyController.find'
to update data.
One suggested me that I can use the alternative way:
'PATCH /companies/find?key=Value'
But I do not know what it works. Please explain me why we prefer ?
mark than :
mark in search path.
It's a rule to design rest apiyou can find 'how to design a rest api'
Assuming below code is Sails.js
It will makes REST API that be mapped onto 'CompanyController.find' by using PathParam. Like this
Second one will makes REST API by using QueryParam.
It also be mapped onto 'CompanyController.find'
But the API format is different. Like this
PathParam or QueryParam is fine to make REST API.
If the Key is primary for company entity, I think PathParam is more proper than QueryParam.