-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Calculating doc URI on the frontend * Correct doc type * Nicer button styling
- Loading branch information
1 parent
4d0333b
commit 1ac0013
Showing
8 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
interface Document {] | ||
uri: string; | ||
interface Document { | ||
filename: string; | ||
filetype: string; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
interface RemoteDocument { | ||
uri: string; | ||
filename: string; | ||
filetype: string; | ||
} | ||
|
||
export type { RemoteDocument }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { sendRequest } from "./backendService"; | ||
import { RemoteDocument } from "../models/document"; | ||
import { getBackendUrl, sendRequest } from "./backendService"; | ||
|
||
async function getDocumentUris(): Promise<Document[]> { | ||
const response = await sendRequest("documents", "GET"); | ||
const data = await response.json(); | ||
return data; | ||
async function getDocumentUris(): Promise<RemoteDocument[]> { | ||
const path = "documents"; | ||
const response = await sendRequest(path, "GET"); | ||
let documents: RemoteDocument[] = await response.json(); | ||
documents = documents.map((document) => { | ||
return { | ||
...document, | ||
uri: `${getBackendUrl()}${path}/${document.filename}`, | ||
} | ||
}); | ||
return documents; | ||
} | ||
|
||
export { getDocumentUris }; |