Skip to content

Commit

Permalink
fix(vue-demo): add missing formatLink function (#1660)
Browse files Browse the repository at this point in the history
Co-authored-by: Patryk Tomczyk <[email protected]>
  • Loading branch information
mdanilowicz and patzick authored Feb 4, 2025
1 parent 7c10417 commit 530b22f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-starfishes-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vue-demo-store": patch
---

Add missing formatLink for links in checkout and my account page
6 changes: 4 additions & 2 deletions templates/vue-demo-store/components/account/AccountOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const props = defineProps<{
const { t } = useI18n();
const { currency } = useSessionContext();
const localePath = useLocalePath();
const { formatLink } = useInternationalization(localePath);
const orderDate = computed(() =>
new Date(props.order.orderDate).toLocaleDateString(
Expand All @@ -36,7 +38,7 @@ const orderDate = computed(() =>
/>
</div>
<div class="hidden sm:block justify-self-end text-dark cursor-pointer">
<NuxtLink :to="`/account/order/details/${order.id}`">
<NuxtLink :to="formatLink(`/account/order/details/${order.id}`)">
{{ t("account.view") }}
</NuxtLink>
</div>
Expand All @@ -45,7 +47,7 @@ const orderDate = computed(() =>
<div
class="block sm:hidden text-center text-dark cursor-pointer bg-secondary py-2"
>
<NuxtLink :to="`/account/order/details/${order.id}`">
<NuxtLink :to="formatLink(`/account/order/details/${order.id}`)">
{{ t("account.view") }}
</NuxtLink>
</div>
Expand Down
6 changes: 3 additions & 3 deletions templates/vue-demo-store/pages/checkout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const placeOrder = async () => {
try {
const order = await createOrder();
await push(`/checkout/success/${order.id}`);
await push(formatLink(`/checkout/success/${order.id}`));
refreshCart();
} catch (error) {
if (error instanceof ApiClientError)
Expand Down Expand Up @@ -277,7 +277,7 @@ const invokeSubmit = async () => {
const response = await register(state);
if (!response.active) {
pushInfo(t("checkout.messages.checkoutSignInSuccess"));
await push("/");
await push(formatLink("/"));
}
} catch (error) {
if (error instanceof ApiClientError) {
Expand All @@ -290,7 +290,7 @@ async function invokeLogout() {
try {
await logout();
} finally {
await push("/");
await push(formatLink("/"));
}
}
Expand Down

0 comments on commit 530b22f

Please sign in to comment.