From 2090677b3de325d1eb769307d7ea2de82de16950 Mon Sep 17 00:00:00 2001 From: M1kola Date: Thu, 13 Jul 2023 02:45:32 +0300 Subject: [PATCH] file --- .../Modal/Tracker/ModalTicket/ModalTicket.jsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx index 7eb10ee2..1a6d3406 100644 --- a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx +++ b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx @@ -68,7 +68,7 @@ export const ModalTiсket = ({ const [executor, setExecutor] = useState(task.executor); const [members, setMembers] = useState(task.taskUsers); const [users, setUsers] = useState([]); - const [selectedFile, setSelectedFile] = useState(''); + const [selectedFile, setSelectedFile] = useState(""); const [timerStart, setTimerStart] = useState(false); const [timerInfo, setTimerInfo] = useState({}); const [currentTimerCount, setCurrentTimerCount] = useState({ @@ -308,32 +308,32 @@ export const ModalTiсket = ({ } }, []); - function handleChange (event) { - setSelectedFile(event.target.files[0]) + function handleChange(event) { + setSelectedFile(event.target.files[0]); } - async function handleUpload () { + async function handleUpload() { const formData = new FormData(); - formData.append('uploadFile', selectedFile); + formData.append("uploadFile", selectedFile); const headers = { "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", - } + }; const fullHeaders = { ...headers, ...getToken() }; const res = await fetch("https://itguild.info/api/file/upload", { method: "POST", body: formData, - headers: { ...fullHeaders } + headers: { ...fullHeaders }, }); - console.log(fullHeaders) - console.log(res) + console.log(fullHeaders); + console.log(res); // apiRequest('/file/upload', { // method: 'POST', // body: formData // }).then((res) => { // }) - }; + } function startTimer() { setTimerId(