module Roqua module CoreApi # @api private class UpdateDossier < Base model :session, class: Sessions::AuthSession model :dossier, class: Models::Dossier # Saves the dossier attributes to server. # Returns true on success, false on validation errors. # Raises on other errors. def execute response = session.patch "/dossiers/#{dossier.id}", dossier: dossier.serializable_hash if response.code == 422 errors_to_object(response, dossier) false else true end end end end end