mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
fix random endpoint and ensure search_records/4 is the only search_records exported
This commit is contained in:
parent
398721a75f
commit
1990e384da
2 changed files with 3 additions and 2 deletions
|
@ -127,7 +127,7 @@ defmodule Philomena.Elasticsearch do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_records(module, elastic_query, pagination_params \\ %{}, ecto_query) do
|
def search_records(module, elastic_query, pagination_params, ecto_query) do
|
||||||
page = search_results(module, elastic_query, pagination_params)
|
page = search_results(module, elastic_query, pagination_params)
|
||||||
ids = page.entries
|
ids = page.entries
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,8 @@ defmodule PhilomenaWeb.Image.RandomController do
|
||||||
},
|
},
|
||||||
sort: sort.sorts
|
sort: sort.sorts
|
||||||
},
|
},
|
||||||
%{page_size: 1}
|
%{page_size: 1},
|
||||||
|
Image
|
||||||
)
|
)
|
||||||
|> Enum.to_list()
|
|> Enum.to_list()
|
||||||
|> unwrap()
|
|> unwrap()
|
||||||
|
|
Loading…
Reference in a new issue