Add data on subscription status to user serializer unless self-hosted

This commit is contained in:
Eugene Burmakin 2025-09-21 15:41:07 +02:00
parent e3795981e3
commit ce4fcc29c3

View file

@ -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