From 7636dc3e83cbfa03aacb50777e69475b2c1c36fe Mon Sep 17 00:00:00 2001 From: Carl-OW <142233642+Carl-OW@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:47:07 +0100 Subject: [PATCH] queryString - dsArticleType --- .../resources/site/parts/relatedArticles/relatedArticles.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/site/parts/relatedArticles/relatedArticles.ts b/src/main/resources/site/parts/relatedArticles/relatedArticles.ts index 09c7473f0..d7b471526 100644 --- a/src/main/resources/site/parts/relatedArticles/relatedArticles.ts +++ b/src/main/resources/site/parts/relatedArticles/relatedArticles.ts @@ -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> = query({