From 80aba915dc45cd3cb2e34f9e0246fbf6ac0c17e7 Mon Sep 17 00:00:00 2001 From: xdj <13580441+gary02@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:49:13 +0800 Subject: [PATCH 1/3] fix(ga4): query article_id from draft table which includes history media_hash --- lib/ga4.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ga4.ts b/lib/ga4.ts index 3f054cd..f088366 100644 --- a/lib/ga4.ts +++ b/lib/ga4.ts @@ -127,12 +127,12 @@ const pathToId = async (path: string) => { }; const hashToId = async (hash: string) => { - const res = await knexRO("article") + const res = await knexRO("draft") .where({ mediaHash: hash }) - .select("id") + .select("article_id") .first(); if (res) { - return res.id; + return res.articleId; } else { return null; } From 272d1c09d23e0976be4f1fec02209f98e1f5abee Mon Sep 17 00:00:00 2001 From: xdj <13580441+gary02@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:03:30 +0800 Subject: [PATCH 2/3] fix(ga4): correct cf config --- deployment/sync-ga-data.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/sync-ga-data.yml b/deployment/sync-ga-data.yml index 04566f5..76fb462 100644 --- a/deployment/sync-ga-data.yml +++ b/deployment/sync-ga-data.yml @@ -149,7 +149,7 @@ Resources: ScheduleExpression: "rate(1 hour)" Targets: - Arn: !GetAtt Lambda.Arn - Id: CronEvent2LambdaTarget + Id: CronEvent3LambdaTarget Input: | { "type": "2 days ago" @@ -167,7 +167,7 @@ Resources: ScheduleExpression: "rate(1 hour)" Targets: - Arn: !GetAtt Lambda.Arn - Id: CronEvent2LambdaTarget + Id: CronEvent4LambdaTarget Input: | { "type": "3 days ago" From 0e7987d7fd8b791aa6effc5505c4d724cf144cd2 Mon Sep 17 00:00:00 2001 From: xdj <13580441+gary02@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:04:21 +0800 Subject: [PATCH 3/3] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 95c8c9a..0baad13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-handlers-image", - "version": "0.8.1", + "version": "0.8.2", "private": true, "type": "module", "scripts": {