✨ test
This commit is contained in:
parent
a5255c0fb7
commit
3a001da691
@ -69,6 +69,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
public override render(): JSX.Element {
|
||||
console.log("Loading :" , this.state.loading);
|
||||
return (
|
||||
<div className={classes["container"]}>
|
||||
<div
|
||||
@ -290,13 +291,14 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private async addFile(file: File) {
|
||||
this.setState({
|
||||
loading: true,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("file", file, file.name);
|
||||
const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
||||
formData.append("q", query);
|
||||
this.setState({
|
||||
loading: true,
|
||||
});
|
||||
|
||||
const newFile = await Files.getInstance().post(formData);
|
||||
const files = this.state.currentFiles ? [...this.state.currentFiles, newFile] : [newFile];
|
||||
|
||||
@ -333,6 +335,9 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private async onFileChange() {
|
||||
this.setState({
|
||||
loading: true,
|
||||
});
|
||||
if (!this.inputRef.current) return;
|
||||
const files = this.inputRef.current.files;
|
||||
if (!files) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user