V
V
Vasyl Fomin2018-06-15 11:38:03
RESTful API
Vasyl Fomin, 2018-06-15 11:38:03

Should I make a separate route for the REST API to change the publication status of an article?

For moderation on the site in the admin panel, you need to be able to view and moderate articles created by users (editing from the admin panel is not planned yet - you just need to change one field - the moderation status).
Advise how it would be more correct:
1) to create a separate route for the "change status" action, for example:

POST: https://site.test/api/v1/admin/article/1/status

{
   "status": "published"
}

2) send to standard RESTful mouth update
PUT: https://site.test/api/v1/admin/article/1
{
   "status": "unpublished"
}
3) возможно есть другие варианты?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question