From ed65336e03c9c9c54482b8c7cc96e0c17c9898db Mon Sep 17 00:00:00 2001 From: happhee Date: Sat, 3 Aug 2024 15:55:27 +0900 Subject: [PATCH] feat : getWithWorkbookList in articlecardmodel --- src/main/models/ArticleCardModel/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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[]; }