diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index 250e72a..909dbc2 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -1760,6 +1760,8 @@ export class HostService { isActive: true, }, select: { + comments: true, + pqqAnswerXid: true, pqqQuestions: { select: { id: true, @@ -1779,17 +1781,21 @@ export class HostService { } } } + }, + + // 🔥 ALL ANSWER OPTIONS FOR THIS QUESTION + PQQAnswers: { + where: { isActive: true }, + select: { + id: true, + answerName: true, + answerPoints: true, + displayOrder: true + }, + orderBy: { displayOrder: "asc" } } } }, - pqqAnswers: { - select: { - id: true, - answerName: true, - answerPoints: true, - displayOrder: true - } - }, ActivityPQQSuggestions: { where: { isActive: true }, select: { @@ -1847,10 +1853,12 @@ export class HostService { id: q.id, questionName: q.questionName, maxPoints: q.maxPoints, + pqqAnswerXid: item.pqqAnswerXid, + comments: item.comments || null, displayOrder: q.displayOrder, - PQQAnswers: item.pqqAnswers ? [item.pqqAnswers] : [], + allAnswerOptions: q.PQQAnswers || [], // 🔥 All answers suggestions: item.ActivityPQQSuggestions, - supportings: item.ActivityPQQSupportings + supportings: item.ActivityPQQSupportings, }); } @@ -1889,6 +1897,4 @@ export class HostService { // ---------- RETURN GROUPED STRUCTURE ---------- return sortedCategories; } - - } diff --git a/src/modules/minglaradmin/services/minglar.service.ts b/src/modules/minglaradmin/services/minglar.service.ts index bb64649..021b44c 100644 --- a/src/modules/minglaradmin/services/minglar.service.ts +++ b/src/modules/minglaradmin/services/minglar.service.ts @@ -1884,6 +1884,8 @@ export class MinglarService { isActive: true, }, select: { + comments: true, + pqqAnswerXid: true, pqqQuestions: { select: { id: true, @@ -1903,17 +1905,21 @@ export class MinglarService { } } } + }, + + // 🔥 ALL ANSWER OPTIONS FOR THIS QUESTION + PQQAnswers: { + where: { isActive: true }, + select: { + id: true, + answerName: true, + answerPoints: true, + displayOrder: true + }, + orderBy: { displayOrder: "asc" } } } }, - pqqAnswers: { - select: { - id: true, - answerName: true, - answerPoints: true, - displayOrder: true - } - }, ActivityPQQSuggestions: { where: { isActive: true }, select: { @@ -1971,8 +1977,10 @@ export class MinglarService { id: q.id, questionName: q.questionName, maxPoints: q.maxPoints, + pqqAnswerXid: item.pqqAnswerXid, + comments: item.comments || null, displayOrder: q.displayOrder, - PQQAnswers: item.pqqAnswers ? [item.pqqAnswers] : [], + allAnswerOptions: q.PQQAnswers || [], suggestions: item.ActivityPQQSuggestions, supportings: item.ActivityPQQSupportings });