Class: Workarea::Api::Admin::FulfillmentsController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#cancel_items ⇒ Object
245
246
247
248
249
250
251
252
253
254
|
# File 'app/controllers/workarea/api/admin/fulfillments_controller.rb', line 245
def cancel_items
if @fulfillment.cancel_items(items)
respond_with(
{ fulfillment: @fulfillment },
{ location: fulfillment_path(@fulfillment) }
)
else
raise Mongoid::Errors::Validations.new(@fulfillment)
end
end
|
#index ⇒ Object
54
55
56
57
58
59
60
61
|
# File 'app/controllers/workarea/api/admin/fulfillments_controller.rb', line 54
def index
@fulfillments = Fulfillment
.all
.order_by(sort_field => sort_direction)
.page(params[:page])
respond_with fulfillments: @fulfillments
end
|
#ship_items ⇒ Object
171
172
173
174
175
176
177
178
179
180
|
# File 'app/controllers/workarea/api/admin/fulfillments_controller.rb', line 171
def ship_items
if @fulfillment.ship_items(params[:tracking_number], items)
respond_with(
{ fulfillment: @fulfillment },
{ location: fulfillment_path(@fulfillment) }
)
else
raise Mongoid::Errors::Validations.new(@fulfillment)
end
end
|
#show ⇒ Object
100
101
102
|
# File 'app/controllers/workarea/api/admin/fulfillments_controller.rb', line 100
def show
respond_with fulfillment: @fulfillment
end
|