Skip to content

Commit

Permalink
Return domain block digests from admin domain blocks API (mastodon#29092
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ThisIsMissEm authored and ttrace committed Jul 5, 2024
1 parent 03ae338 commit 6e29bea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/serializers/rest/admin/domain_block_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# frozen_string_literal: true

class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
attributes :id, :domain, :created_at, :severity,
attributes :id, :domain, :digest, :created_at, :severity,
:reject_media, :reject_reports,
:private_comment, :public_comment, :obfuscate

def id
object.id.to_s
end

def digest
object.domain_digest
end
end
3 changes: 3 additions & 0 deletions spec/requests/api/v1/admin/domain_blocks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
{
id: domain_block.id.to_s,
domain: domain_block.domain,
digest: domain_block.domain_digest,
created_at: domain_block.created_at.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
severity: domain_block.severity.to_s,
reject_media: domain_block.reject_media,
Expand Down Expand Up @@ -102,6 +103,7 @@
{
id: domain_block.id.to_s,
domain: domain_block.domain,
digest: domain_block.domain_digest,
created_at: domain_block.created_at.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
severity: domain_block.severity.to_s,
reject_media: domain_block.reject_media,
Expand Down Expand Up @@ -212,6 +214,7 @@
{
id: domain_block.id.to_s,
domain: domain_block.domain,
digest: domain_block.domain_digest,
severity: 'suspend',
}
)
Expand Down

0 comments on commit 6e29bea

Please sign in to comment.