Make customer add and edit forward back to edit form #62

This commit is contained in:
Kendrick Chan 2018-04-01 02:44:15 +08:00
parent e371d9900d
commit 69bf01fa27
3 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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()
]);
}
}

View file

@ -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 %}
}
});