Use with instead of if in the card
This commit is contained in:
parent
e4d18f328b
commit
833404f0f5
|
@ -186,9 +186,10 @@ def render("card.json", %{rich_media: rich_media, page_url: page_url}) do
|
||||||
page_url_data = URI.parse(page_url)
|
page_url_data = URI.parse(page_url)
|
||||||
|
|
||||||
image_url =
|
image_url =
|
||||||
if %URI{host: nil} = page_url_data do
|
with %URI{host: nil} <- page_url_data do
|
||||||
rich_media[:image]
|
rich_media[:image]
|
||||||
else
|
else
|
||||||
|
_ ->
|
||||||
URI.merge(page_url_data, URI.parse(rich_media[:image]))
|
URI.merge(page_url_data, URI.parse(rich_media[:image]))
|
||||||
|> to_string
|
|> to_string
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue