diff --git a/src/main/models/ArticleCardModel/index.ts b/src/main/models/ArticleCardModel/index.ts index b7e6f031..5e87fa42 100644 --- a/src/main/models/ArticleCardModel/index.ts +++ b/src/main/models/ArticleCardModel/index.ts @@ -18,7 +18,7 @@ export default class ArticleCardModel { content, category, views, - includedWorkbooks, + workbooks, mainImageUrl, }) => { const changeToClientData: ArticleClientInfo = { @@ -32,7 +32,7 @@ export default class ArticleCardModel { content: this.getRemoveTagContent({ content }), category, viewCount: views, - withWorkbookList: includedWorkbooks, + withWorkbookList: this.getWithWorkbookList({ workbooks }), }; return changeToClientData; }, @@ -43,5 +43,8 @@ export default class ArticleCardModel { return content.replace(/<\/?[^>]+(>|$)/g, ""); } + getWithWorkbookList({ workbooks }: Pick) { + return workbooks.length ? workbooks : null; + } private articleCardServerList: ArticleServerInfo[]; }