diff options
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/project_mirror_entity.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/serializers/project_mirror_entity.rb b/app/serializers/project_mirror_entity.rb new file mode 100644 index 00000000000..8051f6e7d35 --- /dev/null +++ b/app/serializers/project_mirror_entity.rb @@ -0,0 +1,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 |