From cfcd83a7c8fec5b121d592080b322ab386693b73 Mon Sep 17 00:00:00 2001 From: fPolic Date: Wed, 28 Aug 2024 17:50:40 +0200 Subject: [PATCH] fix: cleanup --- .../order-receive-return-form/order-receive-return-form.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/admin-next/dashboard/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx b/packages/admin-next/dashboard/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx index ae9db15a14b0d..559133f454af5 100644 --- a/packages/admin-next/dashboard/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx +++ b/packages/admin-next/dashboard/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx @@ -86,7 +86,11 @@ export function OrderReceiveReturnForm({ const form = useForm>({ defaultValues: { - items: [], + items: previewItems + ?.sort((i1, i2) => i1.id.localeCompare(i2.id)) + .map((i) => ({ + item_id: i.id, + })), send_notification: false, }, resolver: zodResolver(ReceiveReturnSchema),