Improve relationship UI handling (#42)

* Added tabbed view; improved relationships for media profile

* Adds new maybe_limit method for queries

* Improves UI for media items, associated tasks
This commit is contained in:
Kieran
2024-02-29 15:35:51 -08:00
committed by GitHub
parent 5b29f5036a
commit b54e69c609
16 changed files with 292 additions and 127 deletions
+11
View File
@@ -3,6 +3,8 @@ defmodule Pinchflat.Repo do
otp_app: :pinchflat,
adapter: Ecto.Adapters.SQLite3
import Ecto.Query, warn: false
@doc """
It's not immediately obvious if an Oban job qualifies as unique, so this method
attempts creating a job and checks for the `conflict?` field in the returned job.
@@ -16,4 +18,13 @@ defmodule Pinchflat.Repo do
err -> err
end
end
@doc """
Applies a limit to a query if provided, otherwise returns the query as-is.
Returns %Ecto.Query{}.
"""
def maybe_limit(query, limit) do
if limit, do: limit(query, ^limit), else: query
end
end