added type declaration on getModels(), to resolve type error

This commit is contained in:
ryansereno
2023-10-08 11:55:10 -04:00
parent d84c000a6a
commit c9d638cc2f

View File

@@ -2,12 +2,14 @@ import { useCallback } from 'react';
import { useFetch } from '@/hooks/useFetch';
import {OllamaModel, OllamaModelDetail} from '@/types/ollama'
const useApiService = () => {
const fetchService = useFetch();
const getModels = useCallback(
() => {
(): Promise<OllamaModel[]> => {
return fetchService.get(`/api/models`, {
headers: {
'Content-Type': 'application/json',