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

Function getProfileRequest

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

Source from the content-addressed store, hash-verified

291};
292
293const getProfileRequest = async (id: string): Promise<ProfileRequestResult> => {
294 const userRes = await fetch(graphqlUrl, {
295 method: 'POST',
296 headers: {
297 'Content-Type': 'application/json',
298 },
299 body: JSON.stringify({
300 query: USER_BY_ID_STATIC_FIELDS_QUERY,
301 variables: {
302 id,
303 },
304 }),
305 credentials: 'include',
306 });
307
308 const status = userRes.status ?? 200;
309 if (status === 404 || status >= 400) {
310 return classifyProfileRequest(status);
311 }
312
313 const response = (await userRes.json()) as ProfileRequestResponse;
314 return classifyProfileRequest(status, response);
315};
316
317const getProfileV2ExtraRequest = async (
318 id: string,

Callers 2

getProfileFunction · 0.85
getProfileForStaticPropsFunction · 0.85

Calls 1

classifyProfileRequestFunction · 0.85

Tested by

no test coverage detected