Bookshelf

This commit is contained in:
2023-06-27 20:59:11 +10:00
parent c9e54bfc04
commit e248cb9146
14 changed files with 91 additions and 38 deletions

View File

@@ -4,8 +4,24 @@ module Adamantium
class Index < Adamantium::View
include Deps["repos.post_repo"]
expose :books do
post_repo.books_listing.map do |book|
private_expose :books do
post_repo.books_listing.group_by { |book| book.book_status }
end
expose :read do |books|
books["read"].map do |book|
Decorators::Books::Decorator.new book
end
end
expose :to_read do |books|
books["to-read"].map do |book|
Decorators::Books::Decorator.new book
end
end
expose :reading do |books|
books["reading"].map do |book|
Decorators::Books::Decorator.new book
end
end