Fix to do not show empty parentheses if no Author's role.

dev
KKlochko 2 months ago
parent 90bacf8e37
commit cffbeb04e7

@ -121,7 +121,7 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
authors_string =
author_roles
|> Enum.map(fn author_role ->
if author_role.role == "" do
if author_role.role in ["", nil] do
{"#{author_role.author.name}", author_role.author.id}
else
{"#{author_role.author.name} (#{author_role.role})", author_role.author.id}

Loading…
Cancel
Save