mirror of
https://github.com/ivanfioravanti/chatbot-ollama.git
synced 2023-12-01 22:17:38 +03:00
added type declaration on getModels(), to resolve type error
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user