From f8d7abdeba10138ceb8eca4437e275c9f9a7c2c3 Mon Sep 17 00:00:00 2001
From: M1kola
Date: Thu, 13 Jul 2023 02:03:53 +0300
Subject: [PATCH] file
---
.../Modal/Tracker/ModalTicket/ModalTicket.jsx | 47 ++++++++++---------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx
index 199ba498..709a3f22 100644
--- a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx
+++ b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx
@@ -10,7 +10,12 @@ import { Link } from "react-router-dom";
import { getProfileInfo } from "@redux/outstaffingSlice";
import { setProjectBoardFetch } from "@redux/projectsTrackerSlice";
-import {caseOfNum, getCorrectRequestDate, getToken, urlForLocal} from "@utils/helper";
+import {
+ caseOfNum,
+ getCorrectRequestDate,
+ getToken,
+ urlForLocal,
+} from "@utils/helper";
import { apiRequest } from "@api/request";
@@ -63,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(null)
+ const [selectedFile, setSelectedFile] = useState(null);
const [timerStart, setTimerStart] = useState(false);
const [timerInfo, setTimerInfo] = useState({});
const [currentTimerCount, setCurrentTimerCount] = useState({
@@ -304,9 +309,8 @@ export const ModalTiсket = ({
}, []);
const handleUpload = async (event) => {
-
- const formData = new FormData()
- formData.append('uploadFile ', event.target.files[0])
+ const formData = new FormData();
+ formData.append("uploadFile ", event.target.files[0]);
// apiRequest('/file/upload', {
// method: 'POST',
// data: {
@@ -316,18 +320,18 @@ export const ModalTiсket = ({
// console.log(res)
// })
// console.log(formData)
- const res = await fetch('https://itguild.info/file/upload', {
- method: 'POST',
+ const res = await fetch("https://itguild.info/file/upload", {
+ method: "POST",
body: formData,
headers: {
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
- ...getToken()
- }
- })
+ ...getToken(),
+ },
+ });
- console.log(res)
- }
+ console.log(res);
+ };
function startTimer() {
setTimerId(
@@ -475,19 +479,16 @@ export const ModalTiсket = ({
{/* */}
{/*
*/}