Update the card components to check a dbi_server existence by the id.

dev
KKlochko 3 weeks ago
parent 03b889b094
commit e4f17524ea

@ -10,7 +10,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.AuthorCard do
def author_card(assigns) do
~H"""
<div class="w-full max-w-sm bg-slate-100 border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3">
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) and is_nil(@author.dbi_server) do %>
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) and is_nil(@author.dbi_server_id) do %>
<div class="flex justify-end px-4 pt-4">
<button
id={"dropdownButton#{@author.id}"}

@ -10,7 +10,7 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.BookCard do
def book_card(assigns) do
~H"""
<div class="w-full max-w-sm bg-slate-100 border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3">
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) and is_nil(@book.dbi_server) do %>
<%= if @current_user != nil and Role.can_moderate?(@current_user.role) and is_nil(@book.dbi_server_id) do %>
<div class="flex justify-end px-4 pt-4">
<button
id={"dropdownButton#{@book.id}"}

Loading…
Cancel
Save