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