Skip to content
Snippets Groups Projects
Unverified Commit 711045a0 authored by clmntsl's avatar clmntsl Committed by GitHub
Browse files

Merge pull request #434 from ProgrammeVitam/cea_app_referential_pr37

[CEA] Fix FileFormat update with empty mimeType and extensions
parents 5da18b52 13758485
No related branches found
No related tags found
1 merge request!51Merge mis a jour vitam-ui
...@@ -64,7 +64,14 @@ export class FileFormatInformationTabComponent { ...@@ -64,7 +64,14 @@ export class FileFormatInformationTabComponent {
private _fileFormat: FileFormat; private _fileFormat: FileFormat;
previousValue = (): FileFormat => { previousValue = (): FileFormat => {
return this._fileFormat; var cleanedFileFortmat = this._fileFormat;
if (!cleanedFileFortmat.mimeType) {
cleanedFileFortmat.mimeType = null;
}
if (!cleanedFileFortmat.extensions) {
cleanedFileFortmat.extensions = null;
}
return cleanedFileFortmat;
} }
@Input() @Input()
...@@ -127,6 +134,8 @@ export class FileFormatInformationTabComponent { ...@@ -127,6 +134,8 @@ export class FileFormatInformationTabComponent {
if (formData.extensions) { if (formData.extensions) {
// The extensions property must be an array of string, not a string // The extensions property must be an array of string, not a string
formData.extensions = formData.extensions.replace(/\s/g, '').split(','); formData.extensions = formData.extensions.replace(/\s/g, '').split(',');
} else if(isEmpty(formData.extensions)){
formData.extensions = [];
} }
return this.fileFormatService.patch(formData).pipe(catchError(() => of(null))) return this.fileFormatService.patch(formData).pipe(catchError(() => of(null)))
})); }));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment