thainv-dev: tạo lại cấu trúc folder và làm UI

This commit is contained in:
nguyen van thai
2024-06-12 17:17:49 +07:00
parent c217ed82c9
commit 5b1e0af397
44 changed files with 2674 additions and 228 deletions
+7 -3
View File
@@ -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