mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Add data on subscription status to user serializer unless self-hosted
This commit is contained in:
parent
e3795981e3
commit
ce4fcc29c3
1 changed files with 13 additions and 2 deletions
|
|
@ -6,15 +6,19 @@ class Api::UserSerializer
|
|||
end
|
||||
|
||||
def call
|
||||
{
|
||||
data = {
|
||||
user: {
|
||||
email: user.email,
|
||||
theme: user.theme,
|
||||
created_at: user.created_at,
|
||||
updated_at: user.updated_at,
|
||||
settings: settings,
|
||||
settings: settings
|
||||
}
|
||||
}
|
||||
|
||||
data.merge!(subscription: subscription) unless DawarichSettings.self_hosted?
|
||||
|
||||
data
|
||||
end
|
||||
|
||||
private
|
||||
|
|
@ -41,4 +45,11 @@ class Api::UserSerializer
|
|||
fog_of_war_threshold: user.safe_settings.fog_of_war_threshold
|
||||
}
|
||||
end
|
||||
|
||||
def subscription
|
||||
{
|
||||
status: user.status,
|
||||
active_until: user.active_until
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue