mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
notify library ID conflict (#509)
This commit is contained in:
@@ -112,7 +112,7 @@ export class LibraryDialogComponent implements OnInit {
|
||||
this.success.emit(folder);
|
||||
dialog.close(folder);
|
||||
},
|
||||
(error) => this.error.emit('LIBRARY.ERRORS.GENERIC')
|
||||
(error) => this.handleError(error)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -137,4 +137,14 @@ export class LibraryDialogComponent implements OnInit {
|
||||
.replace(/[\s]/g, '-')
|
||||
.replace(/[^A-Za-z0-9-]/g, '');
|
||||
}
|
||||
|
||||
private handleError(error: any): any {
|
||||
const { error: { statusCode } } = JSON.parse(error.message);
|
||||
|
||||
if (statusCode === 409) {
|
||||
this.form.controls['id'].setErrors({ message: 'LIBRARY.ERRORS.CONFLICT' });
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user