Sha256: 89eb9b95525b08bdb717552681ba23386bf788b4f3d1541fe238c4343907158e
Contents?: true
Size: 832 Bytes
Versions: 16
Compression:
Stored size: 832 Bytes
Contents
module Workarea module Api module Storefront class OrdersController < Api::Storefront::ApplicationController def index models = Order.recent( current_user.id, Workarea.config.storefront_user_order_display_count ) statuses = Fulfillment.find_statuses(*models.map(&:id)) @orders = models.map do |order| Workarea::Storefront::OrderViewModel.new( order, fulfillment_status: statuses[order.id] ) end end def show model = Order.find(params[:id]) if model.user_id != current_user.id.to_s head :forbidden else @order = Workarea::Storefront::OrderViewModel.new(model) end end end end end end
Version data entries
16 entries across 16 versions & 2 rubygems