CRUD Update for Promotion
This commit is contained in:
@@ -76,6 +76,17 @@ class Settings::PromotionsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def find_item_instance
|
||||
item = MenuItem.find_by_item_code(params[:item_code])
|
||||
if item.nil?
|
||||
product = Product.where("item_code = ?",params[:item_code]).pluck(:name,:item_code)
|
||||
render json: product
|
||||
else
|
||||
menu_instance = MenuItemInstance.where("menu_item_id = ?",item.id).pluck(:item_instance_name,:item_instance_code)
|
||||
render json: menu_instance
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_promotion
|
||||
|
||||
Reference in New Issue
Block a user