From dc55a6bd3a3c6483259d207975a6a3a6fbcb2a6c Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 20 Feb 2024 16:14:27 -0800 Subject: [PATCH] feat(messaging): fix total on topics page --- .../console/project-[project]/messaging/topics/store.ts | 5 ++++- .../console/project-[project]/messaging/topics/table.svelte | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/messaging/topics/store.ts b/src/routes/console/project-[project]/messaging/topics/store.ts index a0f832d2b..742f0a432 100644 --- a/src/routes/console/project-[project]/messaging/topics/store.ts +++ b/src/routes/console/project-[project]/messaging/topics/store.ts @@ -6,6 +6,9 @@ export const showCreate = writable(false); export const columns = writable([ { id: '$id', title: 'Topic ID', type: 'string', show: true, width: 140 }, { id: 'name', title: 'Name', type: 'string', show: true, width: 140 }, - { id: 'total', title: 'Subscribers', type: 'integer', show: true, width: 140 }, + { id: 'emailTotal', title: 'Email Subscribers', type: 'integer', show: false, width: 140 }, + { id: 'smsTotal', title: 'SMS Subscribers', type: 'integer', show: false, width: 140 }, + { id: 'pushTotal', title: 'Push Subscribers', type: 'integer', show: false, width: 140 }, + { id: 'total', title: 'Subscribers', type: 'integer', show: true, filter: false, width: 140 }, { id: '$createdAt', title: 'Created', type: 'datetime', show: true, width: 140 } ]); diff --git a/src/routes/console/project-[project]/messaging/topics/table.svelte b/src/routes/console/project-[project]/messaging/topics/table.svelte index 8118edbf1..8e611a83b 100644 --- a/src/routes/console/project-[project]/messaging/topics/table.svelte +++ b/src/routes/console/project-[project]/messaging/topics/table.svelte @@ -90,6 +90,10 @@ {toLocaleDateTime(topic[column.id])} {/if} + {:else if column.id === 'total'} + + {topic.emailTotal + topic.smsTotal + topic.pushTotal} + {:else} {topic[column.id]}