fix: ensure we dont bloat notification table with any other notification than app

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-09-03 21:39:21 +02:00
parent e5cacb73df
commit 52b86682e2
5 changed files with 33 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
import { useAppParams } from '@/hooks/useAppParams';
import useWS from '@/hooks/useWS';
import type { Notification } from '@openpanel/db';
import type { Prisma } from '@openpanel/db';
import { BellIcon } from 'lucide-react';
import { toast } from 'sonner';
@@ -15,12 +15,15 @@ export function NotificationProvider() {
export function InnerNotificationProvider({
projectId,
}: { projectId: string }) {
useWS<Notification>(`/live/notifications/${projectId}`, (notification) => {
toast(notification.title, {
description: notification.message,
icon: <BellIcon className="size-4" />,
});
});
useWS<Prisma.NotificationUncheckedCreateInput>(
`/live/notifications/${projectId}`,
(notification) => {
toast(notification.title, {
description: notification.message,
icon: <BellIcon className="size-4" />,
});
},
);
return null;
}

View File

@@ -46,14 +46,6 @@ export function useColumns() {
);
},
},
{
accessorKey: 'integration',
header: 'Integration',
cell({ row }) {
const integration = row.original.integration;
return <div>{integration?.name}</div>;
},
},
{
accessorKey: 'notificationRule',
header: 'Rule',