thainnv-dev: Nhúng
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user