Skip to content

Commit

Permalink
cache get paragraph because it also handles redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Jan 2, 2024
1 parent 2dfb5fb commit cb5c648
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions apps/cms/lib/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ defmodule CMS.Repo do
Paragraphs are stand-alone partials from the CMS. Supports redirects.
"""
@spec get_paragraph(String.t(), map) :: Paragraph.t() | {:error, any()}
@decorate cacheable(cache: @cache, on_error: :nothing, opts: [ttl: @ttl])
def get_paragraph(path, query_params \\ %{}) do
case view_or_preview(path, query_params) do
{:ok, api_data} ->
Expand Down

0 comments on commit cb5c648

Please sign in to comment.