updates based on F5 testing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user