refactor: use pipe operator in collection controller params
This commit is contained in:
@@ -17,11 +17,13 @@ defmodule MusicLibraryWeb.CollectionController do
|
|||||||
|
|
||||||
def index(conn, params) do
|
def index(conn, params) do
|
||||||
limit =
|
limit =
|
||||||
Map.get(params, "limit", "20")
|
params
|
||||||
|
|> Map.get("limit", "20")
|
||||||
|> String.to_integer()
|
|> String.to_integer()
|
||||||
|
|
||||||
offset =
|
offset =
|
||||||
Map.get(params, "offset", "0")
|
params
|
||||||
|
|> Map.get("offset", "0")
|
||||||
|> String.to_integer()
|
|> String.to_integer()
|
||||||
|
|
||||||
total = Collection.search_records_count("")
|
total = Collection.search_records_count("")
|
||||||
|
|||||||
Reference in New Issue
Block a user