file
This commit is contained in:
parent
68d5a7ebcc
commit
2090677b3d
@ -68,7 +68,7 @@ export const ModalTiсket = ({
|
|||||||
const [executor, setExecutor] = useState(task.executor);
|
const [executor, setExecutor] = useState(task.executor);
|
||||||
const [members, setMembers] = useState(task.taskUsers);
|
const [members, setMembers] = useState(task.taskUsers);
|
||||||
const [users, setUsers] = useState([]);
|
const [users, setUsers] = useState([]);
|
||||||
const [selectedFile, setSelectedFile] = useState('');
|
const [selectedFile, setSelectedFile] = useState("");
|
||||||
const [timerStart, setTimerStart] = useState(false);
|
const [timerStart, setTimerStart] = useState(false);
|
||||||
const [timerInfo, setTimerInfo] = useState({});
|
const [timerInfo, setTimerInfo] = useState({});
|
||||||
const [currentTimerCount, setCurrentTimerCount] = useState({
|
const [currentTimerCount, setCurrentTimerCount] = useState({
|
||||||
@ -309,31 +309,31 @@ export const ModalTiсket = ({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
function handleChange(event) {
|
function handleChange(event) {
|
||||||
setSelectedFile(event.target.files[0])
|
setSelectedFile(event.target.files[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleUpload() {
|
async function handleUpload() {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('uploadFile', selectedFile);
|
formData.append("uploadFile", selectedFile);
|
||||||
const headers = {
|
const headers = {
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
};
|
||||||
const fullHeaders = { ...headers, ...getToken() };
|
const fullHeaders = { ...headers, ...getToken() };
|
||||||
const res = await fetch("https://itguild.info/api/file/upload", {
|
const res = await fetch("https://itguild.info/api/file/upload", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
headers: { ...fullHeaders }
|
headers: { ...fullHeaders },
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(fullHeaders)
|
console.log(fullHeaders);
|
||||||
console.log(res)
|
console.log(res);
|
||||||
// apiRequest('/file/upload', {
|
// apiRequest('/file/upload', {
|
||||||
// method: 'POST',
|
// method: 'POST',
|
||||||
// body: formData
|
// body: formData
|
||||||
// }).then((res) => {
|
// }).then((res) => {
|
||||||
// })
|
// })
|
||||||
};
|
}
|
||||||
|
|
||||||
function startTimer() {
|
function startTimer() {
|
||||||
setTimerId(
|
setTimerId(
|
||||||
|
Loading…
Reference in New Issue
Block a user