Files
NSG_PORTAL_V2/server/models/poll-option.ts
T

22 lines
499 B
TypeScript
Raw Normal View History

2024-06-06 13:29:22 +07:00
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);
}
}