Advertisement
madrahimov

Untitled

Sep 5th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. # frozen_string_literal: true
  2.  
  3. Rails.application.routes.draw do
  4. default_url_options host: "localhost"
  5. mount Rswag::Ui::Engine => "/api-docs"
  6. mount Rswag::Api::Engine => "/api-docs"
  7.  
  8. namespace :v1, as: nil, defaults: { format: "json" } do
  9.  
  10. resources :apidocs, only: :index
  11.  
  12. devise_for :users, path: "", path_names: {
  13. sign_in: "login",
  14. sign_out: "logout",
  15. registration: "signup",
  16. password: "password",
  17. confirmation: "confirmation"
  18.  
  19. }, controllers: {
  20. sessions: "v1/users/sessions",
  21. registrations: "v1/users/registrations",
  22. passwords: "v1/users/passwords",
  23. confirmations: "v1/users/confirmations"
  24. }
  25.  
  26. devise_scope :user do
  27. post "send_code", to: "users/registrations#send_code"
  28. post "confirm_phone", to: "users/registrations#confirm_phone"
  29. post "password/check", to: "users/passwords#check"
  30. put "confirmation", to: "users/confirmations#update"
  31. post "phone_confirmation", to: "users/confirmations#create_phone_confirmation"
  32. put "phone_confirmation", to: "users/confirmations#update_phone_confirmation"
  33. end
  34.  
  35. resources :cities, only: :index
  36. resources :currencies, only: :index
  37.  
  38. resource :member, only: [:edit, :update, :show, :destroy] do
  39. post :leave_company, on: :collection
  40. post :block_device, on: :collection
  41. end
  42.  
  43. resources :companies, only: [:index, :create, :update, :show] do
  44. get :schemas
  45. post :destroy_company# , on: :collection
  46. resources :users, only: [:index, :new, :create, :edit, :update, :show, :destroy] do
  47. post :invite_to_company, on: :collection
  48. end
  49.  
  50. resources :shops, only: [:index, :create, :update, :show, :destroy] do
  51. post :destroy_shop# , on: :collection
  52. end
  53.  
  54. resources :contractors
  55.  
  56. resources :shops, only: nil, module: :shops do
  57. resources :option_types, only: [:index, :show, :create, :update, :destroy]
  58.  
  59. resources :products, only: [:index, :show, :create, :update] do
  60. post :destroy_products, on: :collection
  61. resources :variants, only: [:update]
  62. end
  63.  
  64. resources :image_assets, only: [:create, :update, :destroy] do
  65. post :upload_base64, on: :collection
  66. end
  67. resources :categories, except: [:new, :edit, :destroy] do
  68. post :destroy_categories, on: :collection
  69. end
  70. resources :tags, only: [:index, :create, :update, :destroy] do
  71. get :search, on: :collection
  72. end
  73. resources :stocks, only: [:index, :create, :update, :show] do
  74. post :destroy_stock, on: :member
  75. end
  76. namespace :settings do
  77. resources :currencies, only: [:index, :create, :destroy] do
  78. resources :rates, only: [:index, :create, :destroy] do
  79. post :load, on: :collection
  80. end
  81. end
  82. resources :units, only: [:index, :create]
  83. resources :taxes, only: [:index, :create, :update, :destroy]
  84. end
  85. end
  86. end
  87.  
  88. end
  89. resources :sms_callbacks, only: [], defaults: { format: "json" }, controller: "sms_callbacks" do
  90. post :sms_ru, on: :collection
  91. end
  92.  
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement