Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/issue_entity.rb')
-rw-r--r--app/serializers/issue_entity.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb
index 3d94d2e2e9d..397f333008c 100644
--- a/app/serializers/issue_entity.rb
+++ b/app/serializers/issue_entity.rb
@@ -7,11 +7,15 @@ class IssueEntity < IssuableEntity
item.try(:upcase)
end
+ format_with(:iso8601) do |item|
+ item.try(:iso8601)
+ end
+
expose :state
expose :milestone_id
expose :updated_by_id
- expose :created_at
- expose :updated_at
+ expose :created_at, format_with: :iso8601
+ expose :updated_at, format_with: :iso8601
expose :milestone, using: API::Entities::Milestone
expose :labels, using: LabelEntity
expose :lock_version
@@ -85,6 +89,11 @@ class IssueEntity < IssuableEntity
end
expose :issue_email_participants do |issue|
+ # TODO - This is a Temporary solution to avoid leaking participants' emails
+ # on public/internal projects when issue is not confidential.
+ # Should be removed when https://gitlab.com/gitlab-org/gitlab/-/issues/383448 is implemented.
+ next [] unless issue.confidential?
+
issue.issue_email_participants.map { |x| { email: x.email } }
end