This repository has no description
1import { verifySessionOnClient } from '@/lib/auth/dal';
2import { createSembleClient } from '@/services/client.apiClient';
3import { cache } from 'react';
4
5export const getProfile = cache(
6 async (didOrHandle: string, includeStats?: boolean) => {
7 const client = createSembleClient();
8 const response = await client.getProfile({
9 identifier: didOrHandle,
10 includeStats,
11 });
12
13 return response;
14 },
15);
16
17export const getMyProfile = cache(async (includeStats?: boolean) => {
18 const session = await verifySessionOnClient({ redirectOnFail: true });
19 if (!session) throw new Error('No session found');
20 const client = createSembleClient();
21 const response = await client.getMyProfile({ includeStats });
22
23 return response;
24});