From 070e2d1d5dead59a7bed43a6ad72b62f7bb77af3 Mon Sep 17 00:00:00 2001 From: weeihan Date: Sat, 11 Jul 2026 18:22:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20CAPA=20owner=20dashboard=20=E2=80=94=20p?= =?UTF-8?q?riority=20null=20guard,=20nulls-last=20due=5Fdate=20sort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(protected)/capa-owner/page.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/(protected)/capa-owner/page.tsx b/app/(protected)/capa-owner/page.tsx index 7b9f2f0..55b4e32 100644 --- a/app/(protected)/capa-owner/page.tsx +++ b/app/(protected)/capa-owner/page.tsx @@ -37,7 +37,7 @@ export default async function CapaOwnerPage() { .from('capa_actions') .select('id, description, due_date, priority, status, incident_id, incidents (reference_no)') .eq('owner_user_id', user.id) - .order('due_date', { ascending: true }) + .order('due_date', { ascending: true, nullsFirst: false }) const rows = capas ?? [] const openCount = rows.filter(c => ['open', 'in_progress', 'reopened'].includes(c.status)).length @@ -90,9 +90,11 @@ export default async function CapaOwnerPage() {

{capa.due_date ? `Due ${new Date(capa.due_date as string).toLocaleDateString('en-MY')}` : 'No due date'}

-

- {(capa.priority as string)?.toUpperCase()} priority -

+ {capa.priority && ( +

+ {(capa.priority as string).toUpperCase()} priority +

+ )}