2019-08-27 20:04:02 +10:00
|
|
|
# frozen_string_literal: true
|
2020-07-06 11:11:04 -05:00
|
|
|
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-09-25 13:20:28 +10:00
|
|
|
scope 'admin' do
|
|
|
|
get '/' => 'admin#index'
|
2021-06-02 13:15:03 -05:00
|
|
|
post '/refresh' => 'admin#refresh_campaign'
|
|
|
|
post '/create-campaign' => 'admin#create_campaign'
|
2019-10-10 12:08:52 +11:00
|
|
|
end
|
|
|
|
|
2021-06-08 17:24:13 -05:00
|
|
|
namespace :admin, constraints: AdminConstraint.new 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
|
2021-01-13 11:47:22 -06:00
|
|
|
resources :coupons, only: [:index, :create]
|
|
|
|
resource :coupons, only: [:destroy, :update]
|
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]
|
2022-07-06 07:23:27 +05:30
|
|
|
resources :subscriptions, only: [:index, :update, :destroy]
|
2019-11-01 13:43:09 +11:00
|
|
|
end
|
|
|
|
|
2020-10-21 13:36:31 -05:00
|
|
|
get '/' => 'subscribe#index'
|
|
|
|
get '.json' => 'subscribe#index'
|
2021-06-02 13:15:03 -05:00
|
|
|
get '/contributors' => 'subscribe#contributors'
|
2020-10-21 13:36:31 -05:00
|
|
|
get '/:id' => 'subscribe#show'
|
|
|
|
post '/create' => 'subscribe#create'
|
|
|
|
post '/finalize' => 'subscribe#finalize'
|
2020-07-24 15:07:18 -05:00
|
|
|
|
2020-08-19 14:37:47 -05:00
|
|
|
post '/hooks' => 'hooks#create'
|
2017-01-31 13:28:41 +11:00
|
|
|
end
|