0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 06:24:48 +08:00
discourse/plugins/discourse-cakeday/app/controllers/discourse_cakeday/birthdays_controller.rb
2025-10-03 18:38:51 +02:00

23 lines
562 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseCakeday
class BirthdaysController < CakedayController
before_action :ensure_birthday_enabled
def index
users, total, more_params = cakedays_by("date_of_birth")
render_json_dump(
birthdays: serialize_data(users, CakedayUserSerializer),
total_rows_birthdays: total,
load_more_birthdays: birthdays_path(more_params),
)
end
private
def ensure_birthday_enabled
raise Discourse::NotFound if !SiteSetting.cakeday_birthday_enabled
end
end
end