fixed conflict

This commit is contained in:
Aung Myo
2017-06-11 18:09:00 +06:30
42 changed files with 610 additions and 431 deletions

View File

@@ -48,7 +48,7 @@ class Crm::CustomersController < BaseCrmController
def create
@crm_customers = Customer.new(customer_params)
respond_to do |format|
if @crm_customers.save
name = customer_params[:name]
@@ -58,8 +58,9 @@ class Crm::CustomersController < BaseCrmController
membership_id = params[:membership_id]
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
app_token = membership.auth_token.to_s
url = membership.gateway_url.to_s + "/api/create_membership_customer".to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
date_of_birth: date_of_birth,
@@ -79,9 +80,6 @@ class Crm::CustomersController < BaseCrmController
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer', notice: 'Customer was successfully created.' }
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' }
end
# format.json { render :index, status: :created, location: @crm_customers }
else
@@ -92,7 +90,7 @@ class Crm::CustomersController < BaseCrmController
else
format.html { redirect_to crm_customers_path, notice: response["message"] }
end
end
# format.json { render :index, status: :created, location: @crm_customers }
@@ -106,7 +104,7 @@ class Crm::CustomersController < BaseCrmController
format.html { redirect_to crm_customers_path}
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
end
end
end
end
@@ -114,7 +112,7 @@ class Crm::CustomersController < BaseCrmController
# PATCH/PUT /crm/customers/1
# PATCH/PUT /crm/customers/1.json
def update
respond_to do |format|
if @crm_customer.update(customer_params)
@@ -125,9 +123,10 @@ class Crm::CustomersController < BaseCrmController
id = customer_params[:membership_id]
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("update_membership_customer")
app_token = membership.auth_token.to_s
url = membership.gateway_url.to_s + "/api/update_membership_customer".to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
date_of_birth: date_of_birth,
id: id}.to_json,
@@ -136,7 +135,7 @@ class Crm::CustomersController < BaseCrmController
'Accept' => 'application/json'
}
)
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
format.json { render :show, status: :ok, location: @crm_customer }
@@ -161,7 +160,21 @@ class Crm::CustomersController < BaseCrmController
# DELETE /crm/customers/1
# DELETE /crm/customers/1.json
# def get_sale_id
# @sale_id = params[:sale_id]
# @crm_customers = Customer.all
# @crm_customer = Customer.new
# @membership = Customer.get_member_group
# if @membership["status"] == true
# @member_group = @membership["data"]
# end
# respond_to do |format|
# format.html { render action: "index"}
# format.json { render json: @crm_customers }
# end
# end
private
# Use callbacks to share common setup or constraints between actions.
@@ -175,5 +188,3 @@ class Crm::CustomersController < BaseCrmController
params.require(:customer).permit(:name, :company, :contact_no, :email, :date_of_birth)
end
end