Skip to content

PR#1999

Open
PavloMolytovnyk wants to merge 2 commits into
mate-academy:masterfrom
PavloMolytovnyk:master
Open

PR#1999
PavloMolytovnyk wants to merge 2 commits into
mate-academy:masterfrom
PavloMolytovnyk:master

Conversation

@PavloMolytovnyk

Copy link
Copy Markdown

No description provided.

PavloMolytovnyk added 2 commits June 4, 2026 23:07

@mateacademy-ai-mentor mateacademy-ai-mentor 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.

Review Summary

Your implementation has critical issues that violate the task requirements. The main problems are: (1) sortList should accept a DOM list element (<ul>) as the list parameter, sort the actual <li> items in-place, and append them back to the DOM — but you're currently passing an already-converted employee array. (2) getEmployees parameter should be named list not pagesTag. (3) parseSalary helper function must be a standalone module-level function, not defined inside sortList. (4) In the execution block at line 26, sortList() is called without arguments when it should receive the DOM list element. The core architecture needs to change so that sortList receives a DOM reference, manipulates <li> elements directly, and the helper functions work with the correct signatures as specified in the requirements.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js
});
}

function sortList(employees) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The function signature doesn't match requirements. The task specifies sortList should take a list property (the DOM list element), not an array of employees. Currently, employee objects are passed instead of the DOM list.

Comment thread src/scripts/main.js
'use strict';

// write code here
function getEmployees(pagesTag) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The function signature doesn't match requirements. The task specifies getEmployees should take a list property (the DOM list element). Currently the parameter is named pagesTag instead of list.

Comment thread src/scripts/main.js
}

const listQuerry = document.querySelectorAll('li');
const list = getEmployees(listQuerry);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to requirements, sortList should sort and append DOM list items directly, not work with an already-converted employee array. The current flow (getEmployees → sortList → rebuild DOM) doesn't match the specified behavior where sortList should manipulate the DOM list directly.

Comment thread src/scripts/main.js

function sortList(employees) {
return employees.sort((a, b) => {
const parseSalary = (salary) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The helper function for salary conversion should be a separate standalone function (as mentioned in requirements), not defined inside sortList. Consider moving parseSalary outside the sorting function.

Comment thread src/scripts/main.js

const listQuerry = document.querySelectorAll('li');
const list = getEmployees(listQuerry);
const sortedEmployees = sortList(list);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The sortList function is called without any arguments here (line 26), but according to requirements, it should be called with the DOM list element as parameter. Similarly, getEmployees on line 25 is called with listQuerry but should be called appropriately per the requirements.

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