Skip to content

Commit 6f6725e

Browse files
Adding impurity in document.tsx code
1 parent 6437951 commit 6f6725e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/frontend/src/pages/document/Document.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const Document = (): JSX.Element => {
1919
setIsLoading(true); // Step 2
2020
try {
2121
const response = await documentRead(id);
22-
const data = await response.json();
23-
setDocument(data);
22+
const data = await response.text(); //
23+
setDocument(data as any); //
2424
} catch (error) {
2525
console.error(error);
2626
setDocument(null);
@@ -30,7 +30,7 @@ const Document = (): JSX.Element => {
3030
};
3131

3232
if (params.id) {
33-
getDocument(params.id);
33+
getDocument(params.id as string); //
3434
}
3535
}, [params.id]);
3636

@@ -41,7 +41,7 @@ const Document = (): JSX.Element => {
4141
) : document ? (
4242
<p>{document.content}</p>
4343
) : (
44-
<h1>Document not found. Please try again.</h1>
44+
<p>Document not found. Please try again.</p>
4545
)}
4646
</>
4747
);

0 commit comments

Comments
 (0)