-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from keep-starknet-strange/lucas/backend
Lucas/backend
- Loading branch information
Showing
10 changed files
with
115 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Peach.TicketTiers do | ||
@moduledoc """ | ||
Manages the events for the peach app | ||
""" | ||
alias Peach.Repo | ||
alias Peach.TicketTier | ||
|
||
import Ecto.Query | ||
|
||
def event_ticket_tiers(event_id), | ||
do: Repo.all(from tt in TicketTier, where: tt.event_id == ^event_id) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
backend/lib/peach_web/controllers/ticket_tier_controller.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule PeachWeb.TicketTierController do | ||
use PeachWeb, :controller | ||
alias Peach.TicketTiers | ||
|
||
def index(conn, %{"id" => event_id}) do | ||
ticket_tiers = TicketTiers.event_ticket_tiers(event_id) | ||
|
||
conn | ||
|> put_status(:ok) | ||
|> json(%{ticket_tiers: ticket_tiers}) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.