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