Applifting / fullstack-exercise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difference between article of List and article

GalichCZ opened this issue · comments

Hello, I'm currently doing this task for applifting to get a chance to start work with you, but I've noticed, that API has some weird behavior.
Like https://fullstack.exercise.applifting.cz/articles returns list of articles, each item of this list has that object structure

{
            "articleId": "2019525c-7aff-408f-97f2-9ea9170d9f63",
            "title": "title",
            "perex": "perex",
            "imageId": null,
            "createdAt": "2023-08-01T10:09:38.110977",
            "lastUpdatedAt": "2023-08-01T10:09:38.110977"
} 

and if i get exact one article by its id it looks like this

{
    "articleId": "57b0049b-4690-45b5-9019-19a377c27b04",
    "title": "title",
    "perex": "perex",
    "content": null,
    "imageId": null,
    "createdAt": "2023-07-31T13:01:58.924668",
    "lastUpdatedAt": "2023-07-31T13:01:58.924668",
    "comments": []
}

So the problem is in pole comments, I understand that it is not relevant to send all comments but isn't it really to send list of DTO with the length of the comments array ? like this

{
            "articleId": "2019525c-7aff-408f-97f2-9ea9170d9f63",
            "title": "title",
            "perex": "perex",
            "imageId": null,
            "createdAt": "2023-08-01T10:09:38.110977",
            "lastUpdatedAt": "2023-08-01T10:09:38.110977",
            "comments": 4
} 

why is it important ? because the figma layout shows that page with the list of articles has number of comments in each article preview