add new field
This commit is contained in:
@@ -10,16 +10,22 @@ class Api::BatchesController < ApplicationController
|
||||
card_qty = params[:card_qty]
|
||||
adult_or_child=params[:adult_or_child]
|
||||
client_id=params[:client_id]
|
||||
product_category_id=params[:product_category_id]
|
||||
|
||||
find_client=Client.find_by_id(client_id)
|
||||
if !find_client.nil?
|
||||
user_id=check_member.user_id
|
||||
batch = Batch.create_batch(created_by,date,order_ref,card_qty,user_id,adult_or_child,client_id)
|
||||
if !batch.nil?
|
||||
@out=true,batch.id
|
||||
else
|
||||
@out=false,'Error occurs in creating batch!'
|
||||
end
|
||||
if !find_client.nil?
|
||||
find_product_category=ProductCategory.find_by_id(product_category_id)
|
||||
if !find_product_category.nil?
|
||||
user_id=check_member.user_id
|
||||
batch = Batch.create_batch(created_by,date,order_ref,card_qty,user_id,adult_or_child,client_id,product_category_id)
|
||||
if !batch.nil?
|
||||
@out=true,batch.id
|
||||
else
|
||||
@out=false,'Error occurs in creating batch!'
|
||||
end
|
||||
else
|
||||
@out=false,'Product Category does not exists!'
|
||||
end
|
||||
else
|
||||
@out = false, "Client does not exist!"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user