feat(messaging): fix total on topics page

This commit is contained in:
Steven Nguyen committed 2024-02-20 16:14:27 -08:00
1 parent 44edd461c6
commit dc55a6bd3a
2 files changed
+8 -1

No files matched your search

@@ -6,6 +6,9 @@ export const showCreate = writable(false);
export const columns = writable<Column[]>([
{ 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 }
]);
@@ -90,6 +90,10 @@
{toLocaleDateTime(topic[column.id])}
{/if}
</TableCellText>
{:else if column.id === 'total'}
<TableCellText title={column.title} width={column.width}>
{topic.emailTotal + topic.smsTotal + topic.pushTotal}
</TableCellText>
{:else}
<TableCellText title={column.title} width={column.width}>
{topic[column.id]}