diff --git a/backend/src/api_types.py b/backend/src/api_types.py index 0e8e91f9..8f8da8df 100644 --- a/backend/src/api_types.py +++ b/backend/src/api_types.py @@ -25,6 +25,9 @@ class CamelModel(BaseModel): class ProteinEntry(CamelModel): name: str id: str + filePDBAlphaFold: str + length: int + mass: float class AllEntries(CamelModel): diff --git a/frontend/src/openapi/models/ProteinEntry.ts b/frontend/src/openapi/models/ProteinEntry.ts index b72fa821..133a26b5 100644 --- a/frontend/src/openapi/models/ProteinEntry.ts +++ b/frontend/src/openapi/models/ProteinEntry.ts @@ -6,5 +6,8 @@ export type ProteinEntry = { name: string; id: string; + filePDBAlphaFold: string; + length: number; + mass: number; }; diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 6e074192..d362025a 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -3,13 +3,14 @@ import { goto } from "$app/navigation"; import { Backend } from "$lib/backend"; import type { ProteinEntry } from "$lib/backend"; - + console.log("Hello World") // at some point, this should be change to request from the backend let allEntries: ProteinEntry[] | null = null; onMount(async () => { // calls get_all_entries() from backend // to generate this Backend object run `./run.sh gen_api` for newly created server functions allEntries = await Backend.getAllEntries(); + console.log(allEntries) }); diff --git a/frontend/src/routes/protein/[proteinId]/+page.svelte b/frontend/src/routes/protein/[proteinId]/+page.svelte index 3268aa2e..e93259eb 100644 --- a/frontend/src/routes/protein/[proteinId]/+page.svelte +++ b/frontend/src/routes/protein/[proteinId]/+page.svelte @@ -14,6 +14,7 @@ console.log("Requesting", data.proteinId, "info from backend"); entry = await Backend.getProteinEntry(data.proteinId); + // if we could not find the entry, the id is garbo if (entry == null) error = true;