diff --git a/packages/admin-api/src/clients/JournalClient.ts b/packages/admin-api/src/clients/JournalClient.ts index 6a5b456..0d1f3ce 100644 --- a/packages/admin-api/src/clients/JournalClient.ts +++ b/packages/admin-api/src/clients/JournalClient.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@halo-dev/rest-api-client' import { buildPath } from '../url' -import { Journal, JournalQuery, JournalType, JournalWithCmtCount, Page, Response } from '../types' +import { Journal, JournalParam, JournalQuery, JournalWithCmtCount, Page, Response } from '../types' export class JournalClient { private client: HttpClient @@ -41,7 +41,7 @@ export class JournalClient { * @param params parameter for creates * @returns A response of created journal. */ - public create(params: Journal): Promise> { + public create(params: JournalParam): Promise> { const path = buildPath({ endpointName: 'journals', }) @@ -55,13 +55,7 @@ export class JournalClient { * @param params parameter for updates * @returns A response of updated journal. */ - public update( - journalId: number, - params: { - sourceContent: string - type?: JournalType - }, - ): Promise> { + public update(journalId: number, params: JournalParam): Promise> { const path = buildPath({ endpointName: `journals/${journalId}`, }) diff --git a/packages/admin-api/src/types/index.ts b/packages/admin-api/src/types/index.ts index d31bf39..ab8e4d7 100644 --- a/packages/admin-api/src/types/index.ts +++ b/packages/admin-api/src/types/index.ts @@ -223,6 +223,13 @@ export type Journal = { type: JournalType } +export type JournalParam = { + sourceContent: string + content: string + type: JournalType + keepRaw?: boolean +} + export interface JournalCommentWithJournal extends BaseComment { journal: Journal }