mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 10:22:16 +00:00
fix(client): use session-user endpoint on client (#66961)
This commit is contained in:
@@ -153,7 +153,7 @@ export function getSessionUser(
|
||||
signal?: AbortSignal
|
||||
): Promise<ResponseWithData<User | null>> {
|
||||
const responseWithData: Promise<ResponseWithData<ApiUserResponse>> = get(
|
||||
'/user/get-session-user',
|
||||
'/user/session-user',
|
||||
signal
|
||||
);
|
||||
// TODO: Once DB is migrated, no longer need to parse `files` -> `challengeFiles` etc.
|
||||
|
||||
+7
-4
@@ -42,10 +42,13 @@ test.describe('Flash Message component E2E test', () => {
|
||||
});
|
||||
|
||||
test('should be visible when a network error occurs', async ({ page }) => {
|
||||
await page.route(
|
||||
'*/**/user/get-session-user',
|
||||
async route => await route.fulfill({ status: 500 })
|
||||
);
|
||||
await page.route('*/**/user/session-user', async route => {
|
||||
await route.fulfill({
|
||||
status: 500,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ user: {}, result: '' })
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
await checkFlashMessageVisibility(
|
||||
|
||||
Reference in New Issue
Block a user