updates based on F5 testing

This commit is contained in:
2020-03-06 08:35:12 -05:00
parent 8288595b3f
commit f1ef618dae
18 changed files with 66 additions and 32 deletions
+12 -11
View File
@@ -3,19 +3,19 @@ module Users
respond_to :json
def show
@table = Table.find(params[:id])
render json: JSONAPI::Serializer.serialize(@table, serializer: Users::TableSerializer)
render json: @table, include: ['supplier']
end
def supplier
table = Table.find(params[:id])
supplier = table.supplier
supplier.product_categories.include_relations(products: :product_variants)
render json: supplier, include: %w[
product_categories
product_categories.products
product_categories.products.product_variants
]
end
#def supplier
# table = Table.find(params[:id])
# supplier = table.supplier
# supplier.product_categories.include_relations(products: :product_variants)
# render json: supplier, include: %w[
# product_categories
# product_categories.products
# product_categories.products.product_variants
# ]
#end
# POST /tables/:id/needs_help.json
def needs_help
@@ -67,6 +67,7 @@ module Users
res = {}
res[:active_list_present] = true if active_list.present?
res[:occupied] = table.occupied?
res[:active] = table.active?
res[:reserved] = table.reserved?
res[:supplier_closed] = table.supplier.closed?
res[:no_product_orders] = true unless product_orders = new_order_product_orders.presence