Merge Dev in Staging
This commit is contained in:
commit
bdeda1ed3e
@ -40,6 +40,7 @@ type IState = {
|
|||||||
refusedReason?: string;
|
refusedReason?: string;
|
||||||
isShowRefusedReasonModalVisible: boolean;
|
isShowRefusedReasonModalVisible: boolean;
|
||||||
showFailedUploaded: string | null;
|
showFailedUploaded: string | null;
|
||||||
|
showFailedDocument: string | null;
|
||||||
isAddDocumentModalVisible: boolean;
|
isAddDocumentModalVisible: boolean;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
};
|
};
|
||||||
@ -159,11 +160,20 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Confirm>
|
</Confirm>
|
||||||
{this.state.showFailedUploaded && (
|
{this.state.showFailedDocument && (
|
||||||
<Alert
|
<Alert
|
||||||
onClose={this.onCloseAlertUpload}
|
onClose={this.onCloseAlertUpload}
|
||||||
header={"Fichier non autorisé"}
|
header={"L'ajout de Document n'est plus autorisé"}
|
||||||
isOpen={!!this.state.showFailedUploaded}>
|
isOpen={!!this.state.showFailedDocument}>
|
||||||
|
<div className={classes["modal-content"]}>
|
||||||
|
<Typography typo={ITypo.P_16} className={classes["text"]}>
|
||||||
|
{this.state.showFailedDocument}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
|
{this.state.showFailedUploaded && (
|
||||||
|
<Alert onClose={this.onCloseAlertUpload} header={"Fichier non autorisé"} isOpen={!!this.state.showFailedUploaded}>
|
||||||
<div className={classes["modal-content"]}>
|
<div className={classes["modal-content"]}>
|
||||||
<Typography typo={ITypo.P_16} className={classes["text"]}>
|
<Typography typo={ITypo.P_16} className={classes["text"]}>
|
||||||
{this.state.showFailedUploaded}
|
{this.state.showFailedUploaded}
|
||||||
@ -180,7 +190,7 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
private onCloseAlertUpload() {
|
private onCloseAlertUpload() {
|
||||||
this.setState({ showFailedUploaded: null });
|
this.setState({ showFailedUploaded: null });
|
||||||
}
|
}
|
||||||
|
|
||||||
private async onAccept() {
|
private async onAccept() {
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
@ -188,15 +198,20 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
const filesArray = this.state.currentFiles;
|
const filesArray = this.state.currentFiles;
|
||||||
|
|
||||||
if (!filesArray) return;
|
if (!filesArray) return;
|
||||||
|
let documentCreated: Document = {} as Document;
|
||||||
const documentCreated = await Documents.getInstance().post({
|
try {
|
||||||
folder: {
|
documentCreated = await Documents.getInstance().post({
|
||||||
uid: this.props.folder_uid,
|
folder: {
|
||||||
},
|
uid: this.props.folder_uid,
|
||||||
depositor: {
|
},
|
||||||
uid: this.props.customer_uid,
|
depositor: {
|
||||||
},
|
uid: this.props.customer_uid,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
this.setState({ showFailedDocument: "Le dossier est vérifié aucune modification n'est acceptée", isLoading: false });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < filesArray.length; i++) {
|
for (let i = 0; i < filesArray.length; i++) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user