send phone

This commit is contained in:
Kseninia Mikhaylova 2024-06-07 13:44:33 +03:00
parent ff3313a471
commit 26a6537071
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,7 @@
<script setup lang="ts">
const config = useRuntimeConfig()
const apiBase = config.public.apiBase
const isModalOpen = useState('modal_open', () => false)
const toggleModal = () => {
modal_phone.value = ''
@ -31,9 +34,15 @@ const validate = () => {
}
}
const submit = (e: any) => {
console.log(e)
modal_phone.value = ''
isModalOpen.value = false
fetch(`${apiBase}/custom_request/`, {
method: 'post',
body: JSON.stringify({
name: "from site",
phone: modal_phone.value
})
})
}
</script>
<template>