supplier client sections working with problematic authentication still active
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user