diff --git a/config/routes/customer.yaml b/config/routes/customer.yaml index 89d361f5..7cc30fe8 100644 --- a/config/routes/customer.yaml +++ b/config/routes/customer.yaml @@ -27,6 +27,9 @@ customer_create_submit: controller: App\Controller\CustomerController::addSubmit methods: [POST] +customer_update_blank: + path: /customers + customer_update: path: /customers/{id} controller: App\Controller\CustomerController::updateForm diff --git a/src/Controller/CustomerController.php b/src/Controller/CustomerController.php index 0d7eb16c..ccf79fbc 100644 --- a/src/Controller/CustomerController.php +++ b/src/Controller/CustomerController.php @@ -294,7 +294,8 @@ class CustomerController extends BaseController // return successful response return $this->json([ - 'success' => 'Changes have been saved!' + 'success' => 'Changes have been saved!', + 'id' => $row->getID() ]); } } @@ -457,7 +458,8 @@ class CustomerController extends BaseController // return successful response return $this->json([ - 'success' => 'Changes have been saved!' + 'success' => 'Changes have been saved!', + 'id' => $cust->getID() ]); } } diff --git a/templates/customer/form.html.twig b/templates/customer/form.html.twig index f3fa16f5..5278a332 100644 --- a/templates/customer/form.html.twig +++ b/templates/customer/form.html.twig @@ -434,7 +434,7 @@ {% if app.request.query.get('ref') == 'jo' %} window.location.href = "{{ url('jo_in') }}"; {% else %} - window.location.href = "{{ url('customer_list') }}"; + window.location.href = "{{ url('customer_update_blank') }}/" + response.id; {% endif %} } });