<template>
  <h2>Shared Order</h2>
  <p>Loading the shared order into the app...</p>
</template>

<script setup>
import {loadShareUrl} from "@/share.js";
import {router} from "@/router/router.js";
import {useRoute} from "vue-router";

const route = useRoute()
const code = route.params.code
loadShareUrl(code).then((ok)=> {
  if (ok) {
    console.log('loaded share data',code)
    router.replace('/order');
  }
  else {
    console.log('failed to load share data',code)
  }
}).catch((e)=> {
  console.error(e)
})
</script>

<style scoped lang="scss">

</style>
