Commit 4be41abb authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'fix-missing-module-around-vsa-serializers' into 'master'

Fix missing module in VSA serializers

See merge request gitlab-org/gitlab!40515
parents 0b24f05d 17523afb
......@@ -11,14 +11,14 @@ class Groups::Analytics::CycleAnalytics::ValueStreamsController < Analytics::App
end
def index
render json: Analytics::GroupValueStreamSerializer.new.represent(value_streams)
render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_streams)
end
def create
value_stream = @group.value_streams.build(value_stream_params)
if value_stream.save
render json: Analytics::GroupValueStreamSerializer.new.represent(value_stream)
render json: Analytics::CycleAnalytics::GroupValueStreamSerializer.new.represent(value_stream)
else
render json: { message: 'Invalid parameters', payload: { errors: value_stream.errors } }, status: :unprocessable_entity
end
......
# frozen_string_literal: true
module Analytics
class GroupValueStreamEntity < Grape::Entity
expose :name
expose :id
expose :is_custom do |object|
object.custom?
end
module CycleAnalytics
class GroupValueStreamEntity < Grape::Entity
expose :name
expose :id
expose :is_custom do |object|
object.custom?
end
private
private
def id
object.id || object.name # use the name `default` if the record is not persisted
def id
object.id || object.name # use the name `default` if the record is not persisted
end
end
end
end
# frozen_string_literal: true
module Analytics
class GroupValueStreamSerializer < BaseSerializer
entity ::Analytics::GroupValueStreamEntity
module CycleAnalytics
class GroupValueStreamSerializer < BaseSerializer
entity ::Analytics::CycleAnalytics::GroupValueStreamEntity
end
end
end
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