mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
enhancement: implement api client in remaining places
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useDropzone } from 'react-dropzone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDispatch } from 'react-redux';
|
||||
|
||||
import userService from '../api/services/userService';
|
||||
import Dropdown from '../components/Dropdown';
|
||||
import Input from '../components/Input';
|
||||
import { ActiveState } from '../models/misc';
|
||||
import { getDocs } from '../preferences/preferenceApi';
|
||||
import { setSelectedDocs, setSourceDocs } from '../preferences/preferenceSlice';
|
||||
import Dropdown from '../components/Dropdown';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Input from '../components/Input';
|
||||
|
||||
function Upload({
|
||||
modalState,
|
||||
@@ -111,8 +112,8 @@ function Upload({
|
||||
|
||||
if ((progress?.percentage ?? 0) < 100) {
|
||||
timeoutID = setTimeout(() => {
|
||||
const apiHost = import.meta.env.VITE_API_HOST;
|
||||
fetch(`${apiHost}/api/task_status?task_id=${progress?.taskId}`)
|
||||
userService
|
||||
.getTaskStatus(progress?.taskId as string)
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
if (data.status == 'SUCCESS') {
|
||||
|
||||
Reference in New Issue
Block a user