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

WG opening listing sorted in chronological order (#2513) #4191

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const useOpeningsPagination = ({ groupId, type, page = 1 }: UseOpeningsPa
limit: OPENINGS_PER_PAGE,
offset: (page - 1) * OPENINGS_PER_PAGE,
where,
order: [WorkingGroupOpeningOrderByInput.CreatedAtDesc, WorkingGroupOpeningOrderByInput.RuntimeIdDesc],
order: [WorkingGroupOpeningOrderByInput.CreatedAtDesc],
Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly this #2513 (comment), the issue is that the openings are ordered by ascending creation date. So this line (order: [WorkingGroupOpeningOrderByInput.CreatedAtDesc, WorkingGroupOpeningOrderByInput.RuntimeIdDesc] looks fine to me, but the problem is still not solved on the preview branch /working-groups/openings:
image

So I'm guessing that maybe this useOpeningsPagination is used to query the openings on a different page. E.g on the WG past openings page the order is correct even in production.

In conclusion I think this change should be reversed and either the hook used to query /working-groups/openings should be fixed or an even better solution would be to reuse the same hook to query openings everywhere.

Also please get reviews from BWG workers before setting jsg-code-review.

}

const { data, loading, error } = useGetWorkingGroupOpeningsQuery({ variables })
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.