Skip to content

Commit

Permalink
feat : getWithWorkbookList in articlecardmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
Happhee committed Aug 3, 2024
1 parent 771c189 commit ed65336
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/models/ArticleCardModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ArticleCardModel {
content,
category,
views,
includedWorkbooks,
workbooks,
mainImageUrl,
}) => {
const changeToClientData: ArticleClientInfo = {
Expand All @@ -32,7 +32,7 @@ export default class ArticleCardModel {
content: this.getRemoveTagContent({ content }),
category,
viewCount: views,
withWorkbookList: includedWorkbooks,
withWorkbookList: this.getWithWorkbookList({ workbooks }),
};
return changeToClientData;
},
Expand All @@ -43,5 +43,8 @@ export default class ArticleCardModel {
return content.replace(/<\/?[^>]+(>|$)/g, "");
}

getWithWorkbookList({ workbooks }: Pick<ArticleServerInfo, "workbooks">) {
return workbooks.length ? workbooks : null;
}
private articleCardServerList: ArticleServerInfo[];
}

0 comments on commit ed65336

Please sign in to comment.