Skip to content

Commit 727c4b6

Browse files
committed
Merge branch 'frontend' of https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g14 into qn-refactor
2 parents da1dad7 + ff29a09 commit 727c4b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

peerprep/api/gateway.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export async function fetchQuestion(
4343
);
4444
if (!response.ok) {
4545
return {
46-
...(await response.json()),
46+
error: await response.text(),
4747
status: response.status,
4848
};
4949
}
5050
return (await response.json()) as Question;
5151
} catch (err: any) {
52-
return { error: err.message, status: 0 };
52+
return { error: err.message, status: 400 };
5353
}
5454
}
5555

peerprep/api/structs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ export interface StatusBody {
3030
}
3131

3232
export function isError(obj: Question | StatusBody): obj is StatusBody {
33-
return (obj as StatusBody).error !== undefined;
33+
return (obj as StatusBody).status !== undefined;
3434
}

0 commit comments

Comments
 (0)