Refactor app in to its own slice

This commit is contained in:
2024-02-17 10:40:36 +11:00
parent b809b132d3
commit a6078f882e
161 changed files with 16176 additions and 193 deletions

View File

@@ -0,0 +1,31 @@
module Main
module Views
module Books
class Index< Main::View
include Deps["repos.post_repo"]
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
end
end
end
end