diff --git a/src/hooks/useAnalogueModels.tsx b/src/hooks/useAnalogueModels.tsx index d2cb2fce..e0e67b43 100644 --- a/src/hooks/useAnalogueModels.tsx +++ b/src/hooks/useAnalogueModels.tsx @@ -12,7 +12,6 @@ type UseQueryOptions = ParamsOption & } const ANALOGUEMODELS_KEY = '/api/analogue-models' -const ANALOGUEMODEL_KEY = '/api/analogue-models/{id}' const NC_FILE_KEY = '/api/analogue-models/{id}/input-models' export function useAnalogueModels(id?: string) { @@ -27,18 +26,6 @@ export function useAnalogueModels(id?: string) { return data } - async function fetchModel({ - params, - }: UseQueryOptions) { - // check id at runtime because it can be undefined - if (params.path.id === undefined) Promise.reject(new Error('Invalid id')) - const { data } = await apiClient.GET(ANALOGUEMODEL_KEY, { - params, - headers: headers, - }) - return data - } - async function createModel({ body, }: UseQueryOptions) { @@ -67,6 +54,7 @@ export function useAnalogueModels(id?: string) { } const models = useQuery(['models', token], fetchModels, { enabled: !!token }) + // TODO: might want to add queryFn to this: const model: AnalogueModel = useQuery([ 'models', token, @@ -75,7 +63,6 @@ export function useAnalogueModels(id?: string) { return { model, - fetchModel, createModel, models, uploadNCFile,