2019-08-27 06:04:02 -04:00
|
|
|
# frozen_string_literal: true
|
2020-07-06 12:11:04 -04:00
|
|
|
require_dependency "subscriptions_user_constraint"
|
2019-08-27 06:04:02 -04:00
|
|
|
|
2019-12-03 19:23:45 -05:00
|
|
|
DiscourseSubscriptions::Engine.routes.draw do
|
2019-09-24 23:20:28 -04:00
|
|
|
scope 'admin' do
|
|
|
|
get '/' => 'admin#index'
|
2021-06-02 14:15:03 -04:00
|
|
|
post '/refresh' => 'admin#refresh_campaign'
|
|
|
|
post '/create-campaign' => 'admin#create_campaign'
|
2019-10-09 21:08:52 -04:00
|
|
|
end
|
|
|
|
|
2021-06-08 18:24:13 -04:00
|
|
|
namespace :admin, constraints: AdminConstraint.new do
|
2019-09-24 23:20:28 -04:00
|
|
|
resources :plans
|
2019-11-13 18:51:04 -05:00
|
|
|
resources :subscriptions, only: [:index, :destroy]
|
2019-10-15 23:15:01 -04:00
|
|
|
resources :products
|
2021-01-13 12:47:22 -05:00
|
|
|
resources :coupons, only: [:index, :create]
|
|
|
|
resource :coupons, only: [:destroy, :update]
|
2019-09-24 23:20:28 -04:00
|
|
|
end
|
|
|
|
|
2019-10-31 22:43:09 -04:00
|
|
|
namespace :user do
|
2019-12-17 00:31:58 -05:00
|
|
|
resources :payments, only: [:index]
|
2022-07-05 21:53:27 -04:00
|
|
|
resources :subscriptions, only: [:index, :update, :destroy]
|
2019-10-31 22:43:09 -04:00
|
|
|
end
|
|
|
|
|
2020-10-21 14:36:31 -04:00
|
|
|
get '/' => 'subscribe#index'
|
|
|
|
get '.json' => 'subscribe#index'
|
2021-06-02 14:15:03 -04:00
|
|
|
get '/contributors' => 'subscribe#contributors'
|
2020-10-21 14:36:31 -04:00
|
|
|
get '/:id' => 'subscribe#show'
|
|
|
|
post '/create' => 'subscribe#create'
|
|
|
|
post '/finalize' => 'subscribe#finalize'
|
2020-07-24 16:07:18 -04:00
|
|
|
|
2020-08-19 15:37:47 -04:00
|
|
|
post '/hooks' => 'hooks#create'
|
2017-01-30 21:28:41 -05:00
|
|
|
end
|