From be48e3b1123b9649ee1d8bb38924f88af3ca4e25 Mon Sep 17 00:00:00 2001 From: wibus-wee <1596355173@qq.com> Date: Mon, 8 Jul 2024 21:06:57 +0800 Subject: [PATCH] feat: add `music` into `PostMeta` --- src/pages/notes/[id].tsx | 3 +-- types.d.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/notes/[id].tsx b/src/pages/notes/[id].tsx index d817317d4..9afb7ca45 100644 --- a/src/pages/notes/[id].tsx +++ b/src/pages/notes/[id].tsx @@ -161,8 +161,7 @@ const NoteView: React.FC<{ id: string }> = memo((props) => { `手记${note.topic ? ` / ${note.topic.name}` : ''}`, ) // Music is deprecated. Use custom meta instead. - // @ts-expect-error Meta 理论上是自定义的,但是 api-client 却将其 hardcode 了。 - useNoteMusic(note.meta?.music as string) + useNoteMusic(note.meta?.music) useJumpToSimpleMarkdownRender(note.id) const { title, id, text } = note diff --git a/types.d.ts b/types.d.ts index 85809af91..aba58bf61 100644 --- a/types.d.ts +++ b/types.d.ts @@ -47,6 +47,7 @@ declare module '@mx-space/api-client' { cover?: string banner?: string | { type: string; message: string } xLog?: XLogMeta + music?: string } interface TextBaseModel extends BaseCommentIndexModel { meta?: PostMeta