Skip to content

Commit 447c4d1

Browse files
tischsoicŁukasz Serwatka
authored andcommitted
EZP-29968: Error 500 for bulk delete/move (#124)
* EZP-29968: Fix bulk request url * Add X-Siteaccess
1 parent f1faaf7 commit 447c4d1

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

Resources/public/js/MultiFileUpload.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/MultiFileUpload.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/SubItems.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/SubItems.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/UniversalDiscovery.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/UniversalDiscovery.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/sub-items/services/bulk.service.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const HEADERS_BULK = {
55
'Content-Type': 'application/vnd.ez.api.BulkOperation+json',
66
};
77
const TRASH_FAKE_LOCATION = '/api/ezp/v2/content/trash';
8+
const ENDPOINT_BULK = '/api/ezp/v2/bulk';
89

910
export const bulkMoveLocations = (restInfo, locations, newLocationHref, callback) => {
1011
const requestBodyOperations = getBulkMoveRequestOperations(locations, newLocationHref);
@@ -53,11 +54,12 @@ const processBulkResponse = (locations, successCode, callback, response) => {
5354
callback(locationsMatches.success, locationsMatches.fail);
5455
};
5556

56-
const makeBulkRequest = ({ token }, requestBodyOperations, callback) => {
57-
const request = new Request(Routing.generate('ezplatform.bulk_operation'), {
57+
const makeBulkRequest = ({ token, siteaccess }, requestBodyOperations, callback) => {
58+
const request = new Request(ENDPOINT_BULK, {
5859
method: 'POST',
5960
headers: {
6061
...HEADERS_BULK,
62+
'X-Siteaccess': siteaccess,
6163
'X-CSRF-Token': token,
6264
},
6365
body: JSON.stringify({

0 commit comments

Comments
 (0)