Sorted performer and performance queries.

This commit is contained in:
codevictory
2021-04-28 21:30:23 +03:00
parent 607ae59589
commit 449bb999ff
4 changed files with 28 additions and 2 deletions

View File

@@ -21,6 +21,19 @@ defmodule Runosaari.Registration do
Repo.all(Performer)
end
@doc """
Returns the list of performers.
## Examples
iex> list_performers()
[%Performer{}, ...]
"""
def list_sorted_performers do
Repo.all(Performer |> order_by(:seqnum))
end
@doc """
Gets a single performer.

View File

@@ -21,6 +21,19 @@ defmodule Runosaari.Schedule do
Repo.all(Performance)
end
@doc """
Returns the list of performances sorted by seqnum.
## Examples
iex> list_sorted_performances()
[%Performance{}, ...]
"""
def list_sorted_performances do
Repo.all(Performance |> order_by(:seqnum))
end
@doc """
Gets a single performance.