refactor: Remove deprecated create_connector_indexed_notification method and add notification types

- Removed the deprecated create_connector_indexed_notification method from NotificationService.
- Introduced new notification types and schemas in notification.types.ts to standardize notification handling.
- Updated useNotifications hook to utilize the new notification type definitions.
This commit is contained in:
Anish Sarkar 2026-01-13 17:21:00 +05:30
parent e38e6d90e0
commit 59a8ef5d64
5 changed files with 115 additions and 60 deletions

View file

@ -2,19 +2,9 @@
import { useEffect, useState, useCallback, useRef } from 'react'
import { initElectric, isElectricInitialized, type ElectricClient, type SyncHandle } from '@/lib/electric/client'
import type { Notification } from '@/contracts/types/notification.types'
export interface Notification {
id: number
user_id: string
search_space_id: number | null
type: string
title: string
message: string
read: boolean
metadata: Record<string, unknown>
created_at: string
updated_at: string | null
}
export type { Notification } from '@/contracts/types/notification.types'
export function useNotifications(userId: string | null) {
const [electric, setElectric] = useState<ElectricClient | null>(null)