( signal?: AbortSignal )
| 150 | } |
| 151 | |
| 152 | export function getSessionUser( |
| 153 | signal?: AbortSignal |
| 154 | ): Promise<ResponseWithData<User | null>> { |
| 155 | const responseWithData: Promise<ResponseWithData<ApiUserResponse>> = get( |
| 156 | '/user/session-user', |
| 157 | signal |
| 158 | ); |
| 159 | // TODO: Once DB is migrated, no longer need to parse `files` -> `challengeFiles` etc. |
| 160 | return responseWithData.then(({ response, data }) => { |
| 161 | const user = parseApiResponseToClientUser(data); |
| 162 | return { |
| 163 | response, |
| 164 | data: user |
| 165 | }; |
| 166 | }); |
| 167 | } |
| 168 | |
| 169 | type UserProfileResponse = { |
| 170 | entities: Omit<ApiUserResponse, 'result'>; |
nothing calls this directly
no test coverage detected