mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
b4fb766b23
- POST /api/v1/push/subscription - PUT /api/v1/push/subscription - DELETE /api/v1/push/subscription - New OAuth scope: "push" (required for the above methods)
14 lines
277 B
Ruby
14 lines
277 B
Ruby
# frozen_string_literal: true
|
|
|
|
class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
|
|
attributes :id, :endpoint, :alerts, :server_key
|
|
|
|
def alerts
|
|
object.data&.dig('alerts') || {}
|
|
end
|
|
|
|
def server_key
|
|
Rails.configuration.x.vapid_public_key
|
|
end
|
|
end
|