add join_request info to active_list info
This commit is contained in:
@@ -149,6 +149,15 @@ class UserController < ApplicationController
|
|||||||
@list = list
|
@list = list
|
||||||
@list.orders.include_relations(product_orders: :product)
|
@list.orders.include_relations(product_orders: :product)
|
||||||
h = @list.as_json
|
h = @list.as_json
|
||||||
|
|
||||||
|
# Handle join requests
|
||||||
|
if @list.join_requests.any?
|
||||||
|
h[:join_requests] = []
|
||||||
|
for user in CouchPotato.database.load_document(@list.join_requests)
|
||||||
|
h[:join_requests] << {user_id: user.id, user_email: user.email}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
h[:orders] = []
|
h[:orders] = []
|
||||||
h[:list_active] = @list.active?
|
h[:list_active] = @list.active?
|
||||||
list_total = 0.0
|
list_total = 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user