From 28f9840b404f2fa3ae692efebcc46e24c41cdd36 Mon Sep 17 00:00:00 2001 From: cristian sandru Date: Thu, 31 Oct 2024 09:40:24 +0200 Subject: [PATCH] code refactor --- apps/web/middleware/reject-empty-checkout.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/middleware/reject-empty-checkout.ts b/apps/web/middleware/reject-empty-checkout.ts index 38f7de243..1e3fb6476 100644 --- a/apps/web/middleware/reject-empty-checkout.ts +++ b/apps/web/middleware/reject-empty-checkout.ts @@ -1,7 +1,8 @@ export default defineNuxtRouteMiddleware(async () => { const { getCart, cartIsEmpty } = useCart(); + const localePath = useLocalePath(); await getCart(); if (!cartIsEmpty.value) return; - return navigateTo(useLocalePath()(paths.cart)); + return navigateTo(localePath(paths.cart)); });