show ON_HOLD responses, but dont show if they have no responses

This commit is contained in:
Danel Kungla
2025-10-10 14:51:05 +03:00
parent e84541339d
commit 2a3f7248a1

View File

@@ -58,6 +58,11 @@ async function enrichAnalysisData(analysisResponses?: AnalysisResponseBase[]) {
.in('primary_owner_user_id', userIds), .in('primary_owner_user_id', userIds),
]); ]);
if (!analysisResponseElements || analysisResponseElements?.length === 0) {
console.info(`${analysisResponseIds} has no response elements`);
return [];
}
const doctorUserIds = const doctorUserIds =
doctorFeedbackItems doctorFeedbackItems
?.map((item) => item.doctor_user_id) ?.map((item) => item.doctor_user_id)
@@ -285,7 +290,6 @@ export async function getOpenResponses({
`, `,
{ count: 'exact' }, { count: 'exact' },
) )
.neq('order_status', 'ON_HOLD')
.order('created_at', { ascending: false }); .order('created_at', { ascending: false });
if (assignedIds.length > 0) { if (assignedIds.length > 0) {