From: Eugen Rochko Date: Sun, 13 May 2018 19:07:31 +0000 (+0200) Subject: Add GET /api/v1/push/subscription REST API (#7471) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=97e43ec5f08aeafe0cb34a2e71e857f22c547f7a;p=mastodon.git Add GET /api/v1/push/subscription REST API (#7471) * Add Api::V1::Push::SubscriptionsController#show * Add to routes --- diff --git a/app/controllers/api/v1/push/subscriptions_controller.rb b/app/controllers/api/v1/push/subscriptions_controller.rb index 5038cc03c..e99f20ca0 100644 --- a/app/controllers/api/v1/push/subscriptions_controller.rb +++ b/app/controllers/api/v1/push/subscriptions_controller.rb @@ -20,6 +20,10 @@ class Api::V1::Push::SubscriptionsController < Api::BaseController render json: @web_subscription, serializer: REST::WebPushSubscriptionSerializer end + def show + render json: @web_subscription, serializer: REST::WebPushSubscriptionSerializer + end + def update raise ActiveRecord::RecordNotFound if @web_subscription.nil? diff --git a/config/routes.rb b/config/routes.rb index b7bd1a7ed..bd9d09226 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -308,7 +308,7 @@ Rails.application.routes.draw do end namespace :push do - resource :subscription, only: [:create, :update, :destroy] + resource :subscription, only: [:create, :show, :update, :destroy] end end