Closed haotianzhu closed 5 years ago
You can always update the whole question byPATCH
.
Since PATCH
is a partially updating method, If you want to set some fields as null, you always need to provide null value.
For example, you want to reset question.responses
as [ ]
you need to
{
...
"responses" : [ ]
...
}
NOTE: you can partially update question. For example, you can
{
"title": "Mock Question 2 new",
}
to change the title
only.
BUT for the nested field like TAG
, RESPONSE
You can partially update the whole RESPONSE
field but not a specific sub-field in RESPONSE
For example, currently question.tags
has two TAG
, one is fun
another is color
.
You can
"tags": [
{
"name": "fun new"
},
{
"name": "color"
}
],
to partial update whole question.tags
only. 👍
But you can't partially update the tag fun
to fun new
, even you give the id
(id
will be ignored)
"tags": [
{
"id": 1,
"name": "fun new"
}
],
This will make question.tags
only contains one tag
👎
@TianqiCS
Check List
[x] Fix #46 (write the relative issue number)
[x] Branch is up to date with master
[x] Now it's a good time for reviewing
[x] Branch should have prefix either "feature/" or "fix/"
Comment
I test following URL
They are good now
There is a detailed document about Question's URLs in the wiki https://github.com/rw-moore/SciLO/wiki/Question-API
Put 'closes #.' in your comment to auto-close the issue that your PR fixes (if such).