Skip to content

Commit

Permalink
나중에 알아볼 수 있도록 files -> fileData로 변수명 변경 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
minpeter committed Oct 20, 2022
1 parent a9c6195 commit 203ab16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const MainPage: React.FC = () => {
const [retentionPeriod, setRetentionPeriod] = useState(false);
const [downloadCount, setDownloadCount] = useState(false);
const [passwordBoolean, setPasswordBoolean] = useState(false);
const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', files: '' });
const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', fileData: '' });

const navigate = useNavigate();

Expand All @@ -26,14 +26,14 @@ export const MainPage: React.FC = () => {
name: event.target.files[0].name,
size: getFileSize(event.target.files[0].size),
fileType: event.target.files[0].name.split('.')[1],
files: event.target.files[0],
fileData: event.target.files[0],
});
};

const UpLoad = async () => {
if (fileProps.name != '' && fileProps.size != '') {
const formdata = new FormData();
formdata.append('file', fileProps.files);
formdata.append('file', fileProps.fileData);
await axios({
method: 'post',
url: 'https://tfb.minpeter.cf/upload',
Expand Down

0 comments on commit 203ab16

Please sign in to comment.