update notifications,
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// api method for get notifications by user id
|
||||
import { pb } from '@/lib/pb';
|
||||
import { COL_NOTIFICATIONS } from '@/constants';
|
||||
import type { Notification } from './type.d';
|
||||
|
||||
export async function getNotificationsByUserId(userId: string): Promise<Notification[]> {
|
||||
const records = await pb.collection(COL_NOTIFICATIONS).getFullList({
|
||||
filter: `author.id = "000000000000001"`,
|
||||
sort: '-created',
|
||||
});
|
||||
return records as unknown as Notification[];
|
||||
}
|
Reference in New Issue
Block a user