send phone
This commit is contained in:
parent
ff3313a471
commit
26a6537071
|
@ -1,4 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
const config = useRuntimeConfig()
|
||||||
|
const apiBase = config.public.apiBase
|
||||||
|
|
||||||
const isModalOpen = useState('modal_open', () => false)
|
const isModalOpen = useState('modal_open', () => false)
|
||||||
const toggleModal = () => {
|
const toggleModal = () => {
|
||||||
modal_phone.value = ''
|
modal_phone.value = ''
|
||||||
|
@ -31,9 +34,15 @@ const validate = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const submit = (e: any) => {
|
const submit = (e: any) => {
|
||||||
console.log(e)
|
|
||||||
modal_phone.value = ''
|
modal_phone.value = ''
|
||||||
isModalOpen.value = false
|
isModalOpen.value = false
|
||||||
|
fetch(`${apiBase}/custom_request/`, {
|
||||||
|
method: 'post',
|
||||||
|
body: JSON.stringify({
|
||||||
|
name: "from site",
|
||||||
|
phone: modal_phone.value
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue