(id: string)
| 291 | }; |
| 292 | |
| 293 | const 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 | |
| 317 | const getProfileV2ExtraRequest = async ( |
| 318 | id: string, |
no test coverage detected