Closed irvinlim closed 7 years ago
@irvinlim you want it keep update and insert in one endpoint? right now I use PATCH for updating an row
Yes preferably. Otherwise I have to GET
first before I decide whether to PUT
or PATCH
.
@irvinlim updating requires the id of the entry but inserting doesn't. so if we do upsert, the id field will be optional?
Because you can only add one reaction per post/comment, you can update based on the provided foreign key.
done
Instead of using POST, we can use PUT (see http://stackoverflow.com/questions/18470588/in-rest-is-post-or-put-best-suited-for-upsert-operation).
The action should allow for upserts, instead of simply inserts.