thainv-dev: tạo lại cấu trúc folder và làm UI
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { H3Event } from 'h3';
|
||||
import Base from './base'
|
||||
|
||||
export type PollSetting = {
|
||||
participantType?: number; // Loại thành phần tham gia
|
||||
resultPublication?: number; // Nguyên tắc công bố kết quả
|
||||
}
|
||||
|
||||
export type Poll = {
|
||||
id?: number; // Mã định danh
|
||||
siteId?: number; // Mã hệ thống
|
||||
@@ -12,7 +17,7 @@ export type Poll = {
|
||||
startTime?: string; // Bắt đầu (string)
|
||||
endTime?: string; // Kết thúc (string)
|
||||
type?: number; // Phân loại
|
||||
settings?: object; // Thiết lập: PollSettings (Json)
|
||||
settings?: PollSetting; // Thiết lập: PollSettings (Json)
|
||||
features?: string; // Đặc trưng: Featured (nổi bật)
|
||||
taxonomy?: string; // Phân nhóm
|
||||
isPublished?: boolean; // Đã xuất bản
|
||||
@@ -25,10 +30,9 @@ export type Poll = {
|
||||
|
||||
export const fetchById = async (event: H3Event) => {
|
||||
try {
|
||||
|
||||
const { apiUrl } = useRuntimeConfig().public
|
||||
const { pollId}: any = getQuery(event)
|
||||
const { item }: any = await $fetch(`${apiUrl}/cms/poll/${pollId}`, {
|
||||
const { item }: Poll | any = await $fetch(`${apiUrl}/cms/poll/${pollId}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
site: 1
|
||||
|
||||
Reference in New Issue
Block a user