diff --git a/src/Components/Scribe/Scribe.tsx b/src/Components/Scribe/Scribe.tsx index f1298bc33c5..80c6c62bf58 100644 --- a/src/Components/Scribe/Scribe.tsx +++ b/src/Components/Scribe/Scribe.tsx @@ -5,10 +5,10 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; import routes from "../../Redux/api"; import * as Notify from "../../Utils/Notifications"; import request from "../../Utils/request/request"; -import axios from "axios"; import { UserModel } from "../Users/models"; import useConfig from "../../Common/hooks/useConfig"; import useSegmentedRecording from "../../Utils/useSegmentedRecorder"; +import uploadFile from "../../Utils/request/uploadFile"; interface FieldOption { id: string | number; @@ -120,21 +120,20 @@ export const Scribe: React.FC = ({ form, onFormUpdate }) => { return; } const newFile = new File([f], `${internal_name}`, { type: f.type }); - const config = { - headers: { - "Content-type": newFile?.type?.split(";")?.[0], - "Content-disposition": "inline", - }, + const headers = { + "Content-type": newFile?.type?.split(";")?.[0], + "Content-disposition": "inline", }; - axios - .put(url, newFile, config) - .then(() => { - resolve(); - }) - .catch((error) => { - reject(error); - }); + uploadFile( + url, + newFile, + "PUT", + headers, + (xhr: XMLHttpRequest) => (xhr.status === 200 ? resolve() : reject()), + null, + reject, + ); }); };