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
@@ -6,6 +6,7 @@ module Suppliers
end
def create
@section_element = SectionElement.new(section_element_params)
@section_element.supplier = current_supplier
if @section_element.save
render json: @section_element
@@ -15,6 +16,7 @@ module Suppliers
end
def update
@section_element = SectionElement.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
if @section_element.update_attributes section_element_params
render json: @section_element
else
@@ -23,6 +25,7 @@ module Suppliers
end
def destroy
@section_element= SectionElement.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@section_element.destroy
head :no_content
end