32 lines
936 B
Ruby
Raw Normal View History

2019-08-27 20:04:02 +10:00
# frozen_string_literal: true
require_dependency "subscriptions_user_constraint"
2019-08-27 20:04:02 +10:00
2019-12-04 11:23:45 +11:00
DiscourseSubscriptions::Engine.routes.draw do
2019-10-10 13:09:24 +11:00
# TODO: namespace this
2019-09-25 13:20:28 +10:00
scope 'admin' do
get '/' => 'admin#index'
2019-10-10 12:08:52 +11:00
end
namespace :admin do
2019-09-25 13:20:28 +10:00
resources :plans
2019-11-14 10:51:04 +11:00
resources :subscriptions, only: [:index, :destroy]
2019-10-16 14:15:01 +11:00
resources :products
2019-09-25 13:20:28 +10:00
end
2019-11-01 13:43:09 +11:00
namespace :user do
2019-12-17 16:31:58 +11:00
resources :payments, only: [:index]
2019-11-04 16:37:21 +11:00
resources :subscriptions, only: [:index, :destroy]
2019-11-01 13:43:09 +11:00
end
resources :customers, only: [:create]
resources :plans, only: [:index], constraints: SubscriptionsUserConstraint.new
2019-11-04 16:37:21 +11:00
resources :products, only: [:index, :show]
resources :subscriptions, only: [:create]
2019-10-10 13:52:55 +11:00
post '/subscriptions/finalize' => 'subscriptions#finalize'
post '/hooks' => 'hooks#create'
get '/' => 'subscriptions#index', constraints: SubscriptionsUserConstraint.new
get '/:id' => 'subscriptions#index', constraints: SubscriptionsUserConstraint.new
2017-01-31 13:28:41 +11:00
end