lib/scrivito/cms_backend.rb in scrivito_sdk-0.70.2 vs lib/scrivito/cms_backend.rb in scrivito_sdk-0.71.0.rc1
- old
+ new
@@ -248,10 +248,22 @@
store_search_result_in_cache(content_state, cache_index, cache_key, result)
end
end
end
+ def create_obj(workspace_id, attributes)
+ write_obj(:post, "/workspaces/#{workspace_id}/objs", attributes)
+ end
+
+ def update_obj(workspace_id, obj_id, attributes)
+ write_obj(:put, "/workspaces/#{workspace_id}/objs/#{obj_id}", attributes)
+ end
+
private
+
+ def write_obj(verb, path, attributes)
+ Backend::ObjDataFromRest.new(CmsRestApi.task_unaware_request(verb, path, attributes))
+ end
def update_workspace_cache(id, cached_data_tag, changed_workspace, options)
if changed_workspace
workspace_data = changed_workspace
else