MCPcopy Create free account
hub / github.com/dailydotdev/apps / getProfileV2ExtraRequest

Function getProfileV2ExtraRequest

packages/shared/src/lib/user.ts:317–339  ·  view source on GitHub ↗
(
  id: string,
)

Source from the content-addressed store, hash-verified

315};
316
317const getProfileV2ExtraRequest = async (
318 id: string,
319): Promise<Omit<ProfileV2, 'user'>> => {
320 const userRes = await fetch(graphqlUrl, {
321 method: 'POST',
322 headers: {
323 'Content-Type': 'application/json',
324 },
325 body: JSON.stringify({
326 query: PROFILE_V2_EXTRA_QUERY,
327 variables: {
328 id,
329 },
330 }),
331 credentials: 'include',
332 });
333 if (userRes.status === 404) {
334 throw new Error('not found');
335 }
336
337 const response = await userRes.json();
338 return response?.data;
339};
340
341export async function getProfile(id: string): Promise<PublicProfile> {
342 const result = await getProfileRequest(id);

Callers 1

getProfileV2ExtraFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected