22 lines
373 B
Ruby
Executable File
22 lines
373 B
Ruby
Executable File
class Api::SaleItemsController < ActionController::API
|
|
|
|
|
|
def create
|
|
@invoice = Sale.find(params[:invoice_id])
|
|
end
|
|
|
|
#Update sale item - Price | Qty |
|
|
def update
|
|
end
|
|
|
|
#destroy - Remove items form invoice
|
|
def destroy
|
|
@sale.remove_item(params[:sale_item_id])
|
|
end
|
|
|
|
private
|
|
def set_invoice_params
|
|
@sale = Sale.find(params[:invoice_id])
|
|
end
|
|
end
|