Change grouped notifications API shape (take 2) (#31214)
This commit is contained in:
parent
288961bbb9
commit
549ab089ee
9 changed files with 70 additions and 20 deletions
|
@ -33,7 +33,8 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
'app.notification_grouping.status.unique_count' => statuses.uniq.size
|
||||
)
|
||||
|
||||
render json: @grouped_notifications, each_serializer: REST::NotificationGroupSerializer, relationships: @relationships, group_metadata: @group_metadata
|
||||
presenter = GroupedNotificationsPresenter.new(@grouped_notifications)
|
||||
render json: presenter, serializer: REST::DedupNotificationGroupSerializer, relationships: @relationships, group_metadata: @group_metadata
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -47,7 +48,8 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
|
||||
def show
|
||||
@notification = current_account.notifications.without_suspended.find_by!(group_key: params[:id])
|
||||
render json: NotificationGroup.from_notification(@notification), serializer: REST::NotificationGroupSerializer
|
||||
presenter = GroupedNotificationsPresenter.new([NotificationGroup.from_notification(@notification)])
|
||||
render json: presenter, serializer: REST::DedupNotificationGroupSerializer
|
||||
end
|
||||
|
||||
def clear
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue