SSHOC / sshoc-marketplace-backend

Code for the backend
Apache License 2.0
2 stars 0 forks source link

`/api/draft-items?order=modified-on` should sort newest first #370

Closed dpancic closed 1 year ago

dpancic commented 2 years ago

In GitLab by @laureD19 on Jul 22, 2022, 12:22

Sorting by last modification doesn't seem to work well in the "my draft items" section. Items should be sorted the other way around!

image

(but ok on the "my contributed items" page)

dpancic commented 2 years ago

In GitLab by @stefanprobst on Jul 22, 2022, 16:16

iirc sorting direction (ascending vs descending) cannot be toggled by the client, so i think this is a backend issue, but let me doublecheck.

tparkola commented 1 year ago

To be honest, after review of the source code, I don't think the sorting works at all. It seems like the sort parameter is not taken into consideration at all. Does it change the order for you when you select sort by label?

stefanprobst commented 1 year ago

you're right - i checked on https://marketplace.sshopencloud.eu/account/draft-items?order=modified-on which displays 3 items (signed in as admin) - changing the "sort by" select does not do anything

KlausIllmayer commented 1 year ago

Reopened because deployment did not work and I reverted the merge of the pull request, @tparkola please check this error and then again create a pull request:

Needed to revert this pullRequest due to errors in deployment: it says in src/main/java/eu/sshopencloud/marketplace/services/items/ItemsService.java:8: import eu.sshopencloud.marketplace.dto.search.SearchOrder; but such a class does not exist. Deployment thus did not work, see action error

You can also have a look at the pull request feedback: https://github.com/SSHOC/sshoc-marketplace-backend/pull/377 - I didn't delete the branch so it should be possible to fix the error and create a new pull request.

tparkola commented 1 year ago

OK, it was because of other pull requests applied before this one. Anyway, it should be fixed now, have a look at https://github.com/SSHOC/sshoc-marketplace-backend/pull/385.

KlausIllmayer commented 1 year ago

Thanks for fixing, everything is fine now. I also tested it on stage and now the sorting of contributed and draft items works as expected.