3PillarGlobal-Czechia / interview-app-api

API for Interview App.
MIT License
3 stars 1 forks source link

TechnicalDebt: Clean API view models #44

Closed PlesnikJakub closed 2 years ago

PlesnikJakub commented 2 years ago

Problem

When fetching from QuestionLists endpoint /api/v1/QuestionLists API fetches QuestionList and all linked questions.

This will result in fetching a lot of unused information.

Explanation

Imagine a case when we have 20 QuestionLists on Page. Every QuestionLists have 20 Questions. But only one QuestionList will be opened and executed.

Furthermore, we fetch ALL QuestionLists and paginate on the client-side, which means there will be 100 maybe more.

!!! Clean and simplify QuestionLists ViewModel. !!!