thainnv-dev: Nhúng

This commit is contained in:
nguyen van thai
2024-06-06 13:29:22 +07:00
parent 0a7774b7f4
commit c217ed82c9
25 changed files with 382 additions and 45 deletions
+24
View File
@@ -0,0 +1,24 @@
import { H3Event } from 'h3';
import Base from './base'
export const create = async (event: H3Event) => {
try {
const { apiUrl } = useRuntimeConfig().public
const payload = await readBody<any>(event)
const { item }: any = await $fetch(`${apiUrl}/cms/poll-response`, {
method: 'POST',
headers: {
site: 1
},
body: {
payload
}
})
return item
} catch (error) {
handleError(error);
}
}