Loading client/src/api/datatypes.ts +12 −6 Original line number Diff line number Diff line import axios from "axios"; import { GalaxyApi } from "@/api"; import type { components } from "@/api"; import { withPrefix } from "@/utils/redirect"; import { rethrowSimple } from "@/utils/simple-error"; export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"]; Loading @@ -10,10 +8,18 @@ export type DatatypeDetails = components["schemas"]["DatatypeDetails"]; /** * Get details about a specific datatype */ export async function fetchDatatypeDetails(extension: string) { export async function fetchDatatypeDetails(extension: string): Promise<DatatypeDetails> { try { const { data } = await axios.get(withPrefix(`/api/datatypes/${extension}`)); return data; const { GET } = GalaxyApi(); const { data } = await GET("/api/datatypes/{datatype}", { params: { path: { datatype: extension }, }, }); if (!data) { throw new Error(`Failed to fetch datatype details for ${extension}`); } return data as DatatypeDetails; } catch (error) { rethrowSimple(error); } Loading Loading
client/src/api/datatypes.ts +12 −6 Original line number Diff line number Diff line import axios from "axios"; import { GalaxyApi } from "@/api"; import type { components } from "@/api"; import { withPrefix } from "@/utils/redirect"; import { rethrowSimple } from "@/utils/simple-error"; export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"]; Loading @@ -10,10 +8,18 @@ export type DatatypeDetails = components["schemas"]["DatatypeDetails"]; /** * Get details about a specific datatype */ export async function fetchDatatypeDetails(extension: string) { export async function fetchDatatypeDetails(extension: string): Promise<DatatypeDetails> { try { const { data } = await axios.get(withPrefix(`/api/datatypes/${extension}`)); return data; const { GET } = GalaxyApi(); const { data } = await GET("/api/datatypes/{datatype}", { params: { path: { datatype: extension }, }, }); if (!data) { throw new Error(`Failed to fetch datatype details for ${extension}`); } return data as DatatypeDetails; } catch (error) { rethrowSimple(error); } Loading