perf: change code position(clean code)
gitea/hedera-web/pipeline/pr-4922-vueMigration This commit looks good Details

This commit is contained in:
Javier Segarra 2024-09-09 22:19:05 +02:00
parent 38a88bb0cc
commit 929623949b
1 changed files with 8 additions and 9 deletions

View File

@ -17,6 +17,14 @@ const rows = ref([]);
const ticket = ref({});
const orderId = ref(null);
onBeforeMount(() => {
appStore.check();
});
onMounted(async () => {
orderId.value = route.params.id || basketOrderId.value;
if (orderId.value) await fetchData();
});
const getOrder = async () => {
try {
const [data] = await jApi.query(
@ -88,15 +96,6 @@ const fetchData = async () => {
await getItems();
await getOrder();
};
onBeforeMount(() => {
appStore.check();
});
onMounted(async () => {
orderId.value = route.params.id || basketOrderId.value;
await fetchData();
});
</script>
<template>