Enable sorting options in collection view

This commit is contained in:
Claudio Ortolina
2024-12-29 15:47:37 +00:00
parent 1534d28c9e
commit 6427710029
8 changed files with 59 additions and 32 deletions
+2 -1
View File
@@ -8,8 +8,9 @@ defmodule MusicLibrary.Collection do
def search_records(query, opts \\ []) do
limit = Keyword.get(opts, :limit, 20)
offset = Keyword.get(opts, :offset, 0)
order = Keyword.get(opts, :order, :alphabetical)
Records.search_records(base_search(), query, limit: limit, offset: offset)
Records.search_records(base_search(), query, limit: limit, offset: offset, order: order)
end
def search_records_count(query) do