Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove api versioning #348

Merged
merged 2 commits into from
Nov 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions lib/safira_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,39 @@ defmodule SafiraWeb.Router do
resources "/passwords", PasswordController, only: [:create, :update]
end

scope "/v1" do
get "/is_registered/:id", AuthController, :is_registered

pipe_through :jwt_authenticated

get "/user", AuthController, :user
get "/attendee", AuthController, :attendee
get "/company", AuthController, :company
get "/leaderboard", LeaderboardController, :index
get "/leaderboard/:date", LeaderboardController, :daily
get "/roulette/latestwins", RouletteController, :latest_wins
get "/store/redeem/:id", DeliverRedeemableController, :show
get "/roulette/redeem/:id", DeliverPrizeController, :show

post "/roulette", RouletteController, :spin
post "/give_bonus/:id", BonusController, :give_bonus
post "/spotlight", SpotlightController, :create
post "/store/redeem", DeliverRedeemableController, :create
post "/roulette/redeem", DeliverPrizeController, :create

delete "/roulette/redeem/:badge_id/:user_id", DeliverPrizeController, :delete

resources "/badges", BadgeController, only: [:index, :show]
resources "/attendees", AttendeeController, except: [:create]
resources "/referrals", ReferralController, only: [:create]
resources "/companies", CompanyController, only: [:index, :show]
resources "/redeems", RedeemController, only: [:create]
resources "/store", RedeemableController, only: [:index, :show]
resources "/association", DiscordAssociationController, only: [:show, :create]
resources "/store/buy", BuyController, only: [:create]
resources "/roulette/prizes", PrizeController, only: [:index, :show]

get "/company/attendees/:id", CompanyController, :company_attendees
get "/company/attendees/cvs/:id", CVController, :company_cvs
end
get "/is_registered/:id", AuthController, :is_registered

pipe_through :jwt_authenticated

get "/user", AuthController, :user
get "/attendee", AuthController, :attendee
get "/company", AuthController, :company
get "/leaderboard", LeaderboardController, :index
get "/leaderboard/:date", LeaderboardController, :daily
get "/roulette/latestwins", RouletteController, :latest_wins
get "/store/redeem/:id", DeliverRedeemableController, :show
get "/roulette/redeem/:id", DeliverPrizeController, :show

post "/roulette", RouletteController, :spin
post "/give_bonus/:id", BonusController, :give_bonus
post "/spotlight", SpotlightController, :create
post "/store/redeem", DeliverRedeemableController, :create
post "/roulette/redeem", DeliverPrizeController, :create

delete "/roulette/redeem/:badge_id/:user_id", DeliverPrizeController, :delete

resources "/badges", BadgeController, only: [:index, :show]
resources "/attendees", AttendeeController, except: [:create]
resources "/referrals", ReferralController, only: [:create]
resources "/companies", CompanyController, only: [:index, :show]
resources "/redeems", RedeemController, only: [:create]
resources "/store", RedeemableController, only: [:index, :show]
resources "/association", DiscordAssociationController, only: [:show, :create]
resources "/store/buy", BuyController, only: [:create]
resources "/roulette/prizes", PrizeController, only: [:index, :show]

get "/company/attendees/:id", CompanyController, :company_attendees
get "/company/attendees/cvs/:id", CVController, :company_cvs
end

scope "/" do
Expand Down
Loading