Update to move get_id functions to support/helpers.

This commit is contained in:
2025-05-24 21:46:02 +03:00
parent 8a3b522049
commit 493aca0e5b
2 changed files with 8 additions and 8 deletions
+7
View File
@@ -41,6 +41,13 @@ defmodule DecentralisedBookIndex.Helpers do
|> DateTime.to_iso8601()
end
def get_ids(records) do
Enum.map(records, fn record -> get_id(record) end)
end
def get_id(record) when is_struct(record), do: record.id
def get_id(record) when is_map(record), do: record[:id]
@doc """
Logs the given `user` into the `conn`.