thainnv-dev: Nhúng

This commit is contained in:
nguyen van thai
2024-06-06 13:29:22 +07:00
parent 0a7774b7f4
commit c217ed82c9
25 changed files with 382 additions and 45 deletions
+43
View File
@@ -0,0 +1,43 @@
import { H3Event } from 'h3';
import Base from './base'
export type Poll = {
id?: number; // Mã định danh
siteId?: number; // Mã hệ thống
title?: string; // Tiêu đề
code?: string; // Nhận diện
keywords?: string; // Từ khóa
thumbnail?: string; // Ảnh nhỏ
description?: string; // Mô tả
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)
features?: string; // Đặc trưng: Featured (nổi bật)
taxonomy?: string; // Phân nhóm
isPublished?: boolean; // Đã xuất bản
publishedBy?: number; // Xuất bản bởi
publishedOn?: string; // Xuất bản vào lúc (string)
expiresOn?: string; // Đã hết hạn vào lúc (string)
order?: number; // Thứ tự sắp xếp
status?: number; // Trạng thái
}
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}`, {
method: 'GET',
headers: {
site: 1
}
})
return item
} catch (error) {
handleError(error);
}
}