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
|
signal?: AbortSignal
|
||||||
): Promise<ResponseWithData<User | null>> {
|
): Promise<ResponseWithData<User | null>> {
|
||||||
const responseWithData: Promise<ResponseWithData<ApiUserResponse>> = get(
|
const responseWithData: Promise<ResponseWithData<ApiUserResponse>> = get(
|
||||||
'/user/get-session-user',
|
'/user/session-user',
|
||||||
signal
|
signal
|
||||||
);
|
);
|
||||||
// TODO: Once DB is migrated, no longer need to parse `files` -> `challengeFiles` etc.
|
// 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 }) => {
|
test('should be visible when a network error occurs', async ({ page }) => {
|
||||||
await page.route(
|
await page.route('*/**/user/session-user', async route => {
|
||||||
'*/**/user/get-session-user',
|
await route.fulfill({
|
||||||
async route => await route.fulfill({ status: 500 })
|
status: 500,
|
||||||
);
|
contentType: 'application/json',
|
||||||
|
body: JSON.stringify({ user: {}, result: '' })
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await checkFlashMessageVisibility(
|
await checkFlashMessageVisibility(
|
||||||
|
|||||||
Reference in New Issue
Block a user