Skip to content

Commit

Permalink
Clean up options
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Nov 19, 2024
1 parent 2c53429 commit 07438f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/opsmaru/content/slide/manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ defmodule Opsmaru.Content.Slide.Manager do

@decorate cacheable(cache: Cache, key: {:slides, options}, opts: [ttl: @ttl])
def list(options \\ []) do
options = Enum.into(options, %{})

query =
~S"""
*[_type == "slide"] | order(index asc) {
Expand All @@ -19,7 +21,7 @@ defmodule Opsmaru.Content.Slide.Manager do

%Sanity.Response{body: %{"result" => slides}} =
query
|> Sanity.query(%{}, perspective: "published")
|> Sanity.query(options, perspective: "published")
|> Sanity.request!(sanity_request_opts())

Enum.map(slides, &Slide.parse/1)
Expand Down

0 comments on commit 07438f5

Please sign in to comment.