Commit 670e88be authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Stan Hu

Refactoring entities file 3

parent e930a6d3
---
title: Add separate classes for user related entities for email, membership, status
merge_request: 23748
author: Rajendra Kadam
type: added
......@@ -2,31 +2,6 @@
module API
module Entities
class Membership < Grape::Entity
expose :source_id
expose :source_name do |member|
member.source.name
end
expose :source_type
expose :access_level
end
class Identity < Grape::Entity
expose :provider, :extern_uid
end
class UserStatus < Grape::Entity
expose :emoji
expose :message
expose :message_html do |entity|
MarkupHelper.markdown_field(entity, :message)
end
end
class Email < Grape::Entity
expose :id, :email
end
class Hook < Grape::Entity
expose :id, :url, :created_at, :push_events, :tag_push_events, :merge_requests_events, :repository_update_events
expose :enable_ssl_verification
......
# frozen_string_literal: true
module API
module Entities
class Email < Grape::Entity
expose :id, :email
end
end
end
# frozen_string_literal: true
module API
module Entities
class Identity < Grape::Entity
expose :provider, :extern_uid
end
end
end
# frozen_string_literal: true
module API
module Entities
class Membership < Grape::Entity
expose :source_id
expose :source_name do |member|
member.source.name
end
expose :source_type
expose :access_level
end
end
end
# frozen_string_literal: true
module API
module Entities
class UserStatus < Grape::Entity
expose :emoji
expose :message
expose :message_html do |entity|
MarkupHelper.markdown_field(entity, :message)
end
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