Refactor for authorization sanity
This commit is contained in:
@@ -27,5 +27,19 @@ module Suppliers
|
||||
format.json { render json: @order }
|
||||
end
|
||||
end
|
||||
# POST /orders/1/mark_in_process
|
||||
def mark_in_process
|
||||
@order = Order.find_by_supplier_id_and_id!(current_supplier.id, params[:id])
|
||||
@order.is_being_processed!
|
||||
head :ok
|
||||
end
|
||||
|
||||
# POST /orders/1/is_delivered
|
||||
def mark_delivered
|
||||
@order = Order.find_by_supplier_id_and_id(current_supplier.id, params[:id])
|
||||
@order.is_delivered!
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user