mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 22:12:53 +00:00
126 lines
2.7 KiB
Ruby
126 lines
2.7 KiB
Ruby
Rails.application.routes.draw do
|
|
get "igdb_matches/index"
|
|
get "igdb_matches/approve"
|
|
get "igdb_matches/reject"
|
|
get "igdb_matches/sync_now"
|
|
get "api_tokens/index"
|
|
get "api_tokens/create"
|
|
get "api_tokens/destroy"
|
|
get "items/index"
|
|
get "items/show"
|
|
get "items/new"
|
|
get "items/create"
|
|
get "items/edit"
|
|
get "items/update"
|
|
get "items/destroy"
|
|
get "collections/index"
|
|
get "collections/show"
|
|
get "collections/new"
|
|
get "collections/create"
|
|
get "collections/edit"
|
|
get "collections/update"
|
|
get "collections/destroy"
|
|
get "collections/games"
|
|
get "games/index"
|
|
get "games/show"
|
|
get "games/new"
|
|
get "games/create"
|
|
get "games/edit"
|
|
get "games/update"
|
|
get "games/destroy"
|
|
get "games/import"
|
|
get "games/bulk_create"
|
|
get "profiles/show"
|
|
get "dashboard/index"
|
|
get "pages/home"
|
|
# Health check
|
|
get "up" => "rails/health#show", as: :rails_health_check
|
|
|
|
# Root and homepage
|
|
root "pages#home"
|
|
get "api-docs", to: "pages#api_docs", as: :api_docs
|
|
|
|
# Authentication
|
|
get "login", to: "sessions#new"
|
|
post "login", to: "sessions#create"
|
|
delete "logout", to: "sessions#destroy"
|
|
get "signup", to: "users#new"
|
|
|
|
# Users
|
|
resources :users, only: [ :create, :edit, :update ] do
|
|
member do
|
|
get :settings
|
|
end
|
|
end
|
|
|
|
# Public profiles
|
|
get "/@:username", to: "profiles#show", as: :profile
|
|
|
|
# Password resets
|
|
resources :password_resets, only: [ :new, :create, :edit, :update ]
|
|
|
|
# Dashboard (after login)
|
|
get "dashboard", to: "dashboard#index"
|
|
|
|
# Games
|
|
resources :games do
|
|
collection do
|
|
get :import
|
|
post :bulk_create
|
|
get :bulk_edit
|
|
patch :bulk_update
|
|
get :search_igdb
|
|
get :search_locations
|
|
get :search_stores
|
|
end
|
|
member do
|
|
patch :add_to_collection
|
|
patch :remove_from_collection
|
|
end
|
|
end
|
|
|
|
# Collections
|
|
resources :collections do
|
|
member do
|
|
get :games
|
|
end
|
|
end
|
|
|
|
# Items (consoles, controllers, etc.)
|
|
resources :items
|
|
|
|
# API namespace
|
|
namespace :api do
|
|
namespace :v1 do
|
|
resources :games do
|
|
collection do
|
|
post :bulk
|
|
end
|
|
end
|
|
resources :collections
|
|
resources :items
|
|
resources :platforms, only: [ :index, :show ]
|
|
resources :genres, only: [ :index, :show ]
|
|
|
|
# API token management
|
|
resources :api_tokens, only: [ :index, :create, :destroy ]
|
|
end
|
|
end
|
|
|
|
# Settings
|
|
get "settings", to: "users#settings"
|
|
get "settings/api_tokens", to: "api_tokens#index", as: :settings_api_tokens
|
|
resources :api_tokens, only: [ :create, :destroy ]
|
|
|
|
# IGDB Matching
|
|
resources :igdb_matches, only: [ :index ] do
|
|
member do
|
|
post :approve
|
|
post :reject
|
|
end
|
|
collection do
|
|
post :sync_now
|
|
end
|
|
end
|
|
end
|