If I had a model with update defined:
- update: 'PUT /api/documents/{_id}?action={action}',
to save with PUT request to /api/documents/1234?action=publish I do:
- modelInstance.attr('action', 'publish')
- modelInstance.save(function(){
- modelInstance.attr('action','')
- })
It will put this parameter in request ("?action=..") despite action is empty (or undefined). And it is not very convenient to set this temporary attribute on instance before save action (after save I usually need remove it.
How do you treat such cases?
Maybe add parameter to save function:
- modelInstance.save({action: 'publish'})
that would add parameter to request?
What do you think?