Skip to content

Commit

Permalink
queryString - dsArticleType
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl-OW committed Dec 12, 2024
1 parent 0cba0a8 commit 7636dc3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ function getDsArticle(
): RelatedArticle | undefined {
statisticPublishDate = statisticPublishDate ? new Date(statisticPublishDate).toLocaleDateString() : ''

const queryString = `data.associatedStatistics.XP.content = "${statisticId}" AND publish.from LIKE "${statisticPublishDate}*" `
const queryString =
dsArticleType === 'lastArticle'
? `data.associatedStatistics.XP.content = "${statisticId}"`
: `data.associatedStatistics.XP.content = "${statisticId}" AND publish.from LIKE "${statisticPublishDate}*" `

const sort = dsArticleType === 'lastArticle' ? 'publish.from DESC' : 'publish.from ASC'

const articleContent: Array<Content<Statistics | Article>> = query({
Expand Down

0 comments on commit 7636dc3

Please sign in to comment.