thainnv-dev: Nhúng
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { H3Event } from 'h3';
|
||||
import Base from './base'
|
||||
|
||||
|
||||
export const fetchByPollId = async (event: H3Event) => {
|
||||
try {
|
||||
|
||||
const { apiUrl } = useRuntimeConfig().public
|
||||
const { pollId}: any = getQuery(event)
|
||||
const { items }: any = await $fetch(`${apiUrl}/cms/poll-option/poll:${pollId}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
site: 1
|
||||
}
|
||||
})
|
||||
|
||||
return items
|
||||
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user