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

solution #1139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

solution #1139

wants to merge 1 commit into from

Conversation

svitlanak31
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the task requirements! 🎉 The code is well-structured and meets the core functionality needed. While there are minor issues with handling null values in URL parameters, they don't significantly impact the functionality. Keep up the good work and consider refining these areas for even better code quality in the future! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +12 to +16
const resetFilters = {
sex: null,
centuries: null,
query: null,
};

Choose a reason for hiding this comment

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

The resetFilters object sets all filter parameters to null. However, setting URL parameters to null might not remove them from the URL. Consider using an empty string or removing the parameters entirely to ensure they are reset properly.

if (currentSort === field && currentOrder === 'asc') {
return { sort: field, order: 'desc' };
} else if (currentSort === field && currentOrder === 'desc') {
return { sort: null, order: null };

Choose a reason for hiding this comment

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

Returning null for sort and order in getNewSortParams might not remove these parameters from the URL. Consider returning an empty object or explicitly removing these parameters to ensure they are reset properly.

}, []);

const query = searchParams.get('query') || '';
const sex = searchParams.get('sex') || null;

Choose a reason for hiding this comment

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

The sex parameter is set to null if not present, which might not be ideal for filtering logic. Consider using an empty string or a default value that aligns with your filtering logic to avoid potential issues.

import { Person } from "../types";

type Filters = {
sex: string | null;

Choose a reason for hiding this comment

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

The sex filter is defined as string | null, but using null might not be ideal for filtering logic. Consider using an empty string or a default value that aligns with your filtering logic to avoid potential issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants