File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1- import axios from "axios" ;
2-
1+ import { GalaxyApi } from "@/api" ;
32import type { components } from "@/api" ;
4- import { withPrefix } from "@/utils/redirect" ;
53import { rethrowSimple } from "@/utils/simple-error" ;
64
75export type CompositeFileInfo = components [ "schemas" ] [ "CompositeFileInfo" ] ;
@@ -10,10 +8,18 @@ export type DatatypeDetails = components["schemas"]["DatatypeDetails"];
108/**
119 * Get details about a specific datatype
1210 */
13- export async function fetchDatatypeDetails ( extension : string ) {
11+ export async function fetchDatatypeDetails ( extension : string ) : Promise < DatatypeDetails > {
1412 try {
15- const { data } = await axios . get ( withPrefix ( `/api/datatypes/${ extension } ` ) ) ;
16- return data ;
13+ const { GET } = GalaxyApi ( ) ;
14+ const { data } = await GET ( "/api/datatypes/{datatype}" , {
15+ params : {
16+ path : { datatype : extension } ,
17+ } ,
18+ } ) ;
19+ if ( ! data ) {
20+ throw new Error ( `Failed to fetch datatype details for ${ extension } ` ) ;
21+ }
22+ return data as DatatypeDetails ;
1723 } catch ( error ) {
1824 rethrowSimple ( error ) ;
1925 }
You can’t perform that action at this time.
0 commit comments