mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
added modal to select source documentation
This commit is contained in:
18
frontend/src/api/docs.ts
Normal file
18
frontend/src/api/docs.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Doc } from '../models/misc';
|
||||
|
||||
export async function getDocs(): Promise<Array<Doc>> {
|
||||
//Fetch default source docs
|
||||
const response = await fetch(
|
||||
'https://d3dg1063dc54p9.cloudfront.net/combined.json',
|
||||
);
|
||||
const data = await response.json();
|
||||
|
||||
//Create array of Doc objects
|
||||
const docs: Array<Doc> = [];
|
||||
|
||||
data.forEach((doc: Doc) => {
|
||||
docs.push(doc);
|
||||
});
|
||||
|
||||
return docs;
|
||||
}
|
||||
Reference in New Issue
Block a user