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
@@ -12,18 +12,21 @@ module Suppliers
render json: @employee_shifts
end
def create
@employee_shift = EmployeeShift.new(employee_shift_params)
@employee_shift.supplier = current_supplier
@employee_shift.save
render json: @employee_shift
end
def update
@employee_shift = EmployeeShift.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@employee_shift.update employee_shift_params
render json: @employee_shift
end
def destroy
head :forbidden and return unless @employee_shift.supplier_id == current_supplier.id
@employee_shift= EmployeeShift.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
@employee_shift.destroy
head :no_content
end