route changes

This commit is contained in:
San Wai Lwin
2018-03-13 14:51:07 +06:30
parent 694feb9c06
commit 9228168ebc
49 changed files with 1906 additions and 707 deletions

View File

@@ -167,7 +167,7 @@ class Crm::CustomersController < BaseCrmController
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' }
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created.' }
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created'}
end
@@ -186,21 +186,21 @@ class Crm::CustomersController < BaseCrmController
if response["message"] == "Account has not exist."
customer.destroy
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer cannot created.' + response["message"]}
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer cannot created.' + response["message"]}
else
format.html { redirect_to crm_customers_path, notice: 'Customer cannot created.' + response["message"] }
end
end
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' + response["message"]}
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created.' + response["message"]}
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' + response["message"] }
end
end
else
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created. noted'}
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created. noted'}
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created. ' }
end
@@ -209,7 +209,7 @@ class Crm::CustomersController < BaseCrmController
if params[:sale_id]
flash[:errors] = @crm_customers.errors
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page]}
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
else
flash[:errors] = @crm_customers.errors