This repository has no description
1import { verifySessionOnClient } from '@/lib/auth/dal';
2import { createSembleClient } from '@/services/apiClient';
3import { cache } from 'react';
4
5interface PageParams {
6 page?: number;
7 limit?: number;
8}
9
10export const getNoteCardsForUrl = cache(
11 async (url: string, params?: PageParams) => {
12 const client = createSembleClient();
13 const response = await client.getNoteCardsForUrl({
14 url,
15 page: params?.page,
16 limit: params?.limit,
17 });
18
19 return response;
20 },
21);
22
23export const updateNoteCard = cache(
24 async (note: { cardId: string; note: string }) => {
25 const session = await verifySessionOnClient();
26 if (!session) throw new Error('No session found');
27 const client = createSembleClient();
28 const response = await client.updateNoteCard(note);
29
30 return response;
31 },
32);