| 237 | } |
| 238 | |
| 239 | const getProfileRequest = async (id: string) => { |
| 240 | const userRes = await fetch(graphqlUrl, { |
| 241 | method: 'POST', |
| 242 | headers: { |
| 243 | 'Content-Type': 'application/json', |
| 244 | }, |
| 245 | body: JSON.stringify({ |
| 246 | query: USER_BY_ID_STATIC_FIELDS_QUERY, |
| 247 | variables: { |
| 248 | id, |
| 249 | }, |
| 250 | }), |
| 251 | credentials: 'include', |
| 252 | }); |
| 253 | if (userRes.status === 404) { |
| 254 | throw new Error('not found'); |
| 255 | } |
| 256 | |
| 257 | const response = await userRes.json(); |
| 258 | return response?.data?.user; |
| 259 | }; |
| 260 | |
| 261 | const getProfileV2ExtraRequest = async ( |
| 262 | id: string, |