| 2 | |
| 3 | // mark as read |
| 4 | export async function mark({ |
| 5 | authId, |
| 6 | threadId, |
| 7 | }: { |
| 8 | authId: string; |
| 9 | threadId: string; |
| 10 | }) { |
| 11 | const notification = await prisma.notifications.findFirst({ |
| 12 | where: { authId, threadId }, |
| 13 | }); |
| 14 | if (!notification) { |
| 15 | return { ok: false, result: 'not_found' }; |
| 16 | } |
| 17 | await prisma.notifications.delete({ where: { id: notification.id } }); |
| 18 | return { ok: true, result: 'deleted' }; |
| 19 | } |
| 20 | |
| 21 | export async function getSettings({ authId }: { authId: string }) { |
| 22 | return await prisma.auths.findUnique({ |