Files
NSG_PORTAL_V2/stores/poll-option.ts
T
2024-06-06 13:29:22 +07:00

20 lines
510 B
TypeScript

export const usePollOptionStore = defineStore('usepollOptionStore', () => {
async function fetchByPollId(id: string) {
const { data, error } = await useFetch<any>(`/api/services/poll-option/pollId`, {
query: {
pollId: id
}
})
if(error.value) {
return null
}
return data.value
}
return { fetchByPollId }
})
if(import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useTagStore, import.meta.hot))
}