summaryrefslogtreecommitdiff
path: root/app/serializers/project_mirror_entity.rb
blob: 8051f6e7d350a8ca1ecb1a85421e08fefadb8c73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class ProjectMirrorEntity < Grape::Entity
  prepend ::EE::ProjectMirrorEntity

  expose :id

  expose :remote_mirrors_attributes do |project|
    next [] unless project.remote_mirrors.present?

    project.remote_mirrors.map do |remote|
      remote.as_json(only: %i[id url enabled])
    end
  end
end