Commit 184163c3 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Michael Kozono

Use NodeUpdateService in update API

parent f9ffb242
---
title: Use NodeUpdateService for updating Geo node
merge_request: 23894
author: Rajendra Kadam
type: changed
......@@ -10,7 +10,7 @@ module Geo
@old_shards = geo_node.selective_sync_shards
@params = params.dup
@params[:namespace_ids] = @params[:namespace_ids].to_s.split(',')
@params[:namespace_ids] = @params[:namespace_ids].to_s.split(',') if @params[:namespace_ids].is_a? String
end
def execute
......
......@@ -193,7 +193,9 @@ module API
update_params = declared_params(include_missing: false)
if geo_node.update(update_params)
updated_geo_node = ::Geo::NodeUpdateService.new(geo_node, update_params).execute
if updated_geo_node
present geo_node, with: EE::API::Entities::GeoNode
else
render_validation_error!(geo_node)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment