From 72183e8e03d6262689cf5ce45cf78097a222f571 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Wed, 25 Oct 2023 12:46:01 +0200 Subject: [PATCH] :hammer: make sure pageviews as 0 and not null --- db/wpdb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/wpdb.ts b/db/wpdb.ts index 3de7d4e6894..3d07ff1d3e3 100644 --- a/db/wpdb.ts +++ b/db/wpdb.ts @@ -690,7 +690,7 @@ export const getRelatedResearchAndWritingForVariable = async ( coalesce(csr.chart_id, c.id) as chartId, p.authors as authors, '' as thumbnail, -- TODO: add thumbnail once we have it - pv.views_365d as pageviews, + coalesce(pv.views_365d, 0) as pageviews, 'wordpress' as post_source from posts_links pl @@ -729,7 +729,7 @@ export const getRelatedResearchAndWritingForVariable = async ( coalesce(csr.chart_id, c.id) as chartId, p.content ->> '$.authors' as authors, p.content ->> '$."featured-image"' as thumbnail, - pv.views_365d as pageviews, + coalesce(pv.views_365d, 0) as pageviews, 'gdocs' as post_source from posts_gdocs_links pl