Skip to content

Commit

Permalink
fix add customer to post and csrf
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Nov 2, 2023
1 parent 271dd16 commit cd97ec5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions frontend/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@
return false;
}
$.ajax({
method : 'POST',
url: '/admin/customermanagementframework/customers/new',
headers: {
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/CustomersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function downloadFinishedExportAction(Request $request): JsonResponse | R
/**
* Create new customer action
*
* @Route("/new")
* @Route("/new", methods={"POST"})
*
* @throws ValidationException
*/
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/public/admin/js/cmf.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,11 @@ app.SearchFilter.DateRangePicker = (function () {
return false;
}
$.ajax({
method : 'POST',
url: '/admin/customermanagementframework/customers/new',
headers: {
'X-Pimcore-Csrf-Token': $newCustomerButton.data('token')
},
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
Expand Down
Loading

0 comments on commit cd97ec5

Please sign in to comment.