def delete(self, collection_uid): """Delete a collection""" collection = Collection.get_active(collection_uid) if collection is None: raise ResourceNotFound('Collection not found') collection.delete() return api_deleted_response()
def patch(self, collection_uid): request_data = get_current_request_data() collection = Collection.get_active(collection_uid) if collection is None: raise ResourceNotFound('Collection not found') params = self.__validate_collection_update_params(request_data) collection = self.edit_collection(collection, params) return api_success_response(collection.as_json())