Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
csandru-plenty committed Oct 31, 2024
1 parent 1a3ee11 commit 28f9840
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/web/middleware/reject-empty-checkout.ts
Original file line number Diff line number Diff line change
@@ -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));
});

0 comments on commit 28f9840

Please sign in to comment.