supplier client sections working with problematic authentication still active

This commit is contained in:
2020-02-27 15:44:43 -05:00
parent 9e86b18c3e
commit 2149345d3d
33 changed files with 456 additions and 281 deletions
@@ -29,7 +29,7 @@ module Suppliers
# GET /products/new
# GET /products/new.json
def new
@product = Product.new
@product = Product.new supplier: current_supplier
@product.add_product_category ProductCategory.find_by_supplier_id_and_id!(current_supplier.id, params[:product_category_id]) if params[:product_category_id].present?
respond_to do |format|
@@ -46,7 +46,7 @@ module Suppliers
# POST /products
# POST /products.json
def create
#@product = Product.new(product_params)
@product = Product.new(product_params)
@product.supplier = current_supplier
respond_to do |format|
@@ -79,7 +79,7 @@ module Suppliers
# DELETE /products/1
# DELETE /products/1.json
def destroy
#@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@product = Product.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@product.destroy
head :no_content
end