thainv-dev: tạo lại cấu trúc folder và làm UI
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
import { H3Event } from 'h3';
|
||||
import Base from './base'
|
||||
|
||||
export type PollOption = {
|
||||
id?: number; // Mã định danh
|
||||
siteId?: number; // Mã hệ thống
|
||||
pollId?: number; // Mã bình chọn
|
||||
title?: string; // Tiêu đề
|
||||
thumbnail?: string; // Ảnh đại diện
|
||||
description?: string; // Mô tả
|
||||
type?: number; // Phân loại
|
||||
order?: number; // Sắp xếp
|
||||
status?: number; // Trạng thái
|
||||
responsesCount?: number //số lượng response của option
|
||||
}
|
||||
|
||||
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}`, {
|
||||
const { pollId }: any = getQuery(event)
|
||||
const { items }: PollOption[] | any = await $fetch(`${apiUrl}/cms/poll-option/poll:${pollId}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
site: 1
|
||||
|
||||
Reference in New Issue
Block a user