refactor: update news types and enhance news data handling in components

This commit is contained in:
Ardeman
2025-03-09 12:32:36 +08:00
parent 9f82779456
commit 7afabdaa03
8 changed files with 101 additions and 148 deletions
+2 -17
View File
@@ -1,22 +1,7 @@
import type { TTagResponse } from '~/apis/common/get-tags'
import type { TNewsResponse } from '~/apis/common/get-news'
export type TNews = {
title: string
description: string
items: Pick<
TNewsDetail,
'title' | 'content' | 'featured' | 'slug' | 'tags' | 'isPremium'
>[]
}
type TNewsDetail = {
title: string
content: string
featured: string
author: string
date: Date
slug: string
tags?: TTagResponse[]
isPremium?: boolean
categories?: Array<string>
items: TNewsResponse[]
}