Skip to content

Monerh A - #12

Open
Miuroro wants to merge 2 commits into
HackYourAssignment:mainfrom
Miuroro:main
Open

Miuroro wants to merge 2 commits into
HackYourAssignment:mainfrom
Miuroro:main

Conversation

@Miuroro

@Miuroro Miuroro commented Mar 11, 2026

Copy link
Copy Markdown

No description provided.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 100 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 50
🧪 The auto grade is experimental and still being improved

Test Details
Vitest unit test results:

✅ post.sh: Script exists
✅ post.sh: Create user John Doe
✅ patch.sh: Script exists
✅ patch.sh: Correct the email address
✅ get.sh: Script exists
✅ get.sh: Retrieve user John Doe details
✅ delete.sh: Script exists
✅ delete.sh: Delete user John Doe
✅ get.sh: Verify user John Doe has been deleted
✅ Uses the correct base URL
✅ URL includes the nobelPrizeYear query parameter
✅ URL includes the nobelPrizeCategory query parameter
✅ URL includes the offset query parameter
✅ URL includes the limit query parameter
✅ Omits the nobelPrizeYear when set to "all"
✅ Omits the nobelPrizeCategory when set to "all"
✅ Includes the sort query parameter set to desc

Total passed: 17
Total failed: 0
Killed

@remarcmij remarcmij self-assigned this Mar 11, 2026

@remarcmij remarcmij left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @Miuroro, good work. One minor simplification could be made, see my comment below.

Comment thread task-2/services.js
Comment on lines +19 to +24
if (filters.year && filters.year !== 'all') {
url += `&nobelPrizeYear=${filters.year}`;
}
if (filters.category && filters.category !== 'all'){
url += `&nobelPrizeCategory=${filters.category}`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This will work too, because filters.year will be undefined if the .year property does not exist, and undefined !== 'all. Some for .category.

Suggested change
if (filters.year && filters.year !== 'all') {
url += `&nobelPrizeYear=${filters.year}`;
}
if (filters.category && filters.category !== 'all'){
url += `&nobelPrizeCategory=${filters.category}`;
}
if (filters.year !== 'all') {
url += `&nobelPrizeYear=${filters.year}`;
}
if (filters.category !== 'all'){
url += `&nobelPrizeCategory=${filters.category}`;
}

@remarcmij remarcmij added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants