refactor: update news types and enhance news data handling in components
This commit is contained in:
+2
-17
@@ -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[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user