From eafedb13d6ecab06d4c57fc9f2768b71350a34c1 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 7 Apr 2025 19:35:49 +0100 Subject: [PATCH] refactor: use pipe operator in collection controller params --- lib/music_library_web/controllers/collection_controller.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/music_library_web/controllers/collection_controller.ex b/lib/music_library_web/controllers/collection_controller.ex index 2c6b1aa9..6c1fb172 100644 --- a/lib/music_library_web/controllers/collection_controller.ex +++ b/lib/music_library_web/controllers/collection_controller.ex @@ -17,11 +17,13 @@ defmodule MusicLibraryWeb.CollectionController do def index(conn, params) do limit = - Map.get(params, "limit", "20") + params + |> Map.get("limit", "20") |> String.to_integer() offset = - Map.get(params, "offset", "0") + params + |> Map.get("offset", "0") |> String.to_integer() total = Collection.search_records_count("")