2018-07-16 12:31:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-03-29 07:45:15 -04:00
|
|
|
module Labels
|
|
|
|
class UpdateService < Labels::BaseService
|
|
|
|
def initialize(params = {})
|
|
|
|
@params = params.dup.with_indifferent_access
|
|
|
|
end
|
|
|
|
|
|
|
|
# returns the updated label
|
|
|
|
def execute(label)
|
|
|
|
params[:color] = convert_color_name_to_hex if params[:color].present?
|
|
|
|
|
|
|
|
label.update(params)
|
|
|
|
label
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|