DEV: move post flags into database (#27125)

This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
This commit is contained in:
Krzysztof Kotlarek
2024-05-23 12:19:07 +10:00
committed by GitHub
parent 312a930ac8
commit cfbbfd177c
30 changed files with 380 additions and 104 deletions

View File

@ -350,13 +350,6 @@ class SiteSerializer < ApplicationSerializer
private
def ordered_flags(flags)
notify_moderators_type = PostActionType.flag_types[:notify_moderators]
types = flags
if notify_moderators_flag = types.index(notify_moderators_type)
types.insert(types.length, types.delete_at(notify_moderators_flag))
end
types.map { |id| PostActionType.new(id: id) }
flags.map { |id| PostActionType.new(id: id) }
end
end