Update the card components to check a dbi_server existence by the id.
This commit is contained in:
@@ -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}"}
|
||||
|
||||
Reference in New Issue
Block a user