Files
redux-scraper/config/routes.rb
Dylan Knutson ec26e425c6 Add FA Cookies management functionality
- Introduced methods for managing FurAffinity cookies in the GlobalStatesController, including `fa_cookies`, `edit_fa_cookies`, and `update_fa_cookies`.
- Added a new policy for managing FA cookies, restricting access to admin users.
- Created views for displaying and editing FA cookies, enhancing user interaction.
- Updated routes to include paths for FA cookies management.
- Added comprehensive tests for the new functionality in the GlobalStatesController spec.
2024-12-30 01:39:21 +00:00

100 lines
2.7 KiB
Ruby

Rails.application.routes.draw do
mount ActionCable.server => "/cable"
# Authentication routes
devise_for :users,
controllers: {
registrations: "users/registrations",
sessions: "users/sessions",
}
root to: "pages#root"
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
namespace :api do
namespace :fa do
get :similar_users, to: "/domain/fa/api#similar_users"
get :search_user_names, to: "/domain/fa/api#search_user_names"
end
end
namespace :domain do
namespace :fa do
resources :users,
param: :url_name,
only: [:show],
constraints: {
url_name: %r{[^/]+},
} do
resources :posts, controller: "/domain/fa/posts"
end
resources :posts, param: :fa_id, only: [:show] do
post :scan_post, on: :member
get :favorites, on: :member
end
end
namespace :e621 do
resources :posts, param: :e621_id, only: [:show]
end
namespace :inkbunny, path: "ib" do
resources :posts, only: %i[show]
resources :users, param: :name, only: [:show]
end
end
resources :blobs, only: [], slug: :sha256 do
get :contents, on: :member
end
namespace :domain do
namespace :fa do
resources :users, param: :url_name, only: [] do
end
resources :posts, param: :fa_id, only: [:index] do
end
end
end
resources :indexed_posts, only: [:index], path: "posts"
resources :blobs, only: [:show], slug: :sha256
get "us/:script", to: "user_scripts#get", constraints: { script: /.*/ }
scope constraints: VpnOnlyRouteConstraint.new do
mount PgHero::Engine => "pghero"
mount GoodJob::Engine => "jobs"
namespace :api do
get "search/user/:prefix", to: "search#user"
namespace :fa do
post :enqueue_objects, to: "/domain/fa/api#enqueue_objects"
post :object_statuses, to: "/domain/fa/api#object_statuses"
end
namespace :twitter do
post :enqueue_objects, to: "/domain/twitter/api#enqueue_objects"
post :object_statuses, to: "/domain/twitter/api#object_statuses"
end
end
resources :log_entries, only: %i[index show] do
get :stats, on: :collection
get "filter/*filter",
on: :collection,
action: :index,
constraints: {
filter: /.*/,
}
end
end
resources :global_states, path: "state" do
collection do
get "fa-cookies", to: "global_states#fa_cookies"
get "fa-cookies/edit", to: "global_states#edit_fa_cookies"
patch "fa-cookies", to: "global_states#update_fa_cookies"
end
end
end