DEV: Update API documentation for invites (#12360)

This commit is contained in:
Dan Ungureanu
2021-03-11 18:19:32 +02:00
committed by GitHub
parent 36ec09a07b
commit 9c93a62b97
4 changed files with 36 additions and 9 deletions

View File

@ -5,9 +5,10 @@ class InviteSerializer < ApplicationSerializer
:link,
:email,
:emailed,
:redemption_count,
:max_redemptions_allowed,
:redemption_count,
:custom_message,
:created_at,
:updated_at,
:expires_at,
:expired
@ -27,6 +28,18 @@ class InviteSerializer < ApplicationSerializer
object.emailed_status != Invite.emailed_status_types[:not_required]
end
def include_custom_message?
email.present?
end
def include_max_redemptions_allowed?
email.blank?
end
def include_redemption_count?
email.blank?
end
def expired
object.expired?
end