Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-30245: Bulk delete - item is removed to trash, but user gets permission message #161

Merged

Conversation

ViniTou
Copy link
Contributor

@ViniTou ViniTou commented Mar 18, 2019

JIRA: https://jira.ez.no/browse/EZP-30245

Desc

When location which is tied with content with other locations is moved to trash, 204 code instead of hardcoded 201 is returned.

@ViniTou ViniTou force-pushed the EZP-30245-bulk-delete-multiple-locations branch from e44be68 to d30dfb6 Compare March 18, 2019 09:41
const { operations } = response.BulkOperationResponse;
const locationsMatches = Object.entries(operations).reduce(
(locationsMatches, [locationId, response]) => {
const respectiveItem = locations.find((location) => location.id === parseInt(locationId, 10));
const isSuccess = response.statusCode === successCode;
const isSuccess = 200 <= response.statusCode <= 299;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

200 <= 400 <= 299 returns true

Suggested change
const isSuccess = 200 <= response.statusCode <= 299;
const isSuccess = 200 <= response.statusCode && response.statusCode <= 299;

@ViniTou ViniTou force-pushed the EZP-30245-bulk-delete-multiple-locations branch from d30dfb6 to 21c93de Compare March 18, 2019 09:51
@tischsoic tischsoic added the Bug label Mar 18, 2019
@barbaragr barbaragr self-assigned this Mar 18, 2019
@lserwatka
Copy link
Member

@ViniTou rebase is required.

@ViniTou ViniTou force-pushed the EZP-30245-bulk-delete-multiple-locations branch from 21c93de to a83af3e Compare March 18, 2019 15:23
@lserwatka lserwatka merged commit 7734265 into ezsystems:1.4 Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants