| 315 | }; |
| 316 | |
| 317 | const 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 | |
| 341 | export async function getProfile(id: string): Promise<PublicProfile> { |
| 342 | const result = await getProfileRequest(id); |