SEL-Columbia/dokomoforms

Change the way update API endpoints work

vr2262 opened this issue · 2 comments

At the moment, you supply only the things that you want updated.

To make things easier and more consistent, the entire survey should be supplied, making update and create philosophically very similar.

As per this commit: ebe8e66, the api.survey.update function now takes in data from the entire survey as opposed to only the things that have changed.

However, a possible problem with this is that there is no way to rename a choice, only reorganize or add. In other words, if the existing choices are ["red", "blue", "green"], you can update them to ["green", "red", "yellow"]red and green have been rearranged, yellow has been added, and blue has been deleted. But there is no way to rename red to RED, for instance.

If this is functionality that we want (and I think it is), then the update request JSON will need some syntax for it. It could be something like:
["green", {"old_choice": "red", "new_choice": "RED"}, "yellow"].

What do you think, @csytan?