add task solution#2030
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job! 🎉 Your code meets all the core requirements and functions as expected. While the use of the non-null assertion operator (!) when assigning the user could be improved for robustness, it does not break any core requirements for this task. Just keep in mind for future projects that handling potential undefined values more safely can help prevent runtime errors. Keep up the good work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
|
||
| const preparedPosts: Post[] = postsFromServer.map(post => ({ | ||
| ...post, | ||
| user: usersFromServer.find(user => user.id === post.userId)!, |
There was a problem hiding this comment.
Issue: The use of the non-null assertion operator (!) after 'usersFromServer.find(...)' assumes that a user will always be found for every post. If a user is missing, this will cause a runtime error. Please ensure that this is allowed by the task requirements or handle the case where a user might not be found, as required by the checklist.
https://katarzynamilewska.github.io/react_static-list-of-posts/