Enhance PQQ data retrieval: Add comments and pqqAnswerXid fields to the selection in HostService and MinglarService. Update PQQAnswers structure to include all answer options for questions, improving data handling in responses.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user