создаю телегу товаров
All checks were successful
Deploy / build (push) Successful in 45s

This commit is contained in:
alsaze
2025-10-05 15:54:16 +03:00
parent 4c8aebddf6
commit dd7abe1fc6
3 changed files with 17 additions and 3 deletions

View File

@@ -22,14 +22,17 @@
<script setup lang="ts">
// import { usePostOrdersCreate } from '~/api/mutations/wp'
import type { IBspb } from '~/server/shared/types/bspb'
const { cart } = useCart()
// const { mutateAsync } = usePostOrdersCreate()
const createOrder = async () => {
// await mutateAsync({ line_items: cart.value.line_items })
const { data } = await useFetch('/api/bspb')
console.log(data.value)
const { data } = await useFetch<IBspb>('/api/bspb')
window.open(`${data?.value?.order?.hppUrl}?orderId=${data?.value?.order?.id}&accessToken=${data.value?.order?.accessToken}`, '_blank')
}
</script>