Commit 06a87305 authored by Florent Poittevin's avatar Florent Poittevin Committed by Alicia.DeDiosFuente
Browse files

fix: [DLCM-1991] custom metadata fie upload fail

parent c3e904e4
......@@ -199,10 +199,6 @@ export interface DepositStateModel extends ResourceLogoStateModel<Deposit> {
],
})
export class DepositState extends ResourceLogoState<DepositStateModel, Deposit> {
private readonly _CATEGORY_KEY: string = "category";
private readonly _TYPE_KEY: string = "type";
private readonly _METADATA_TYPE_KEY: string = "metadataType";
private readonly _FOLDER_KEY: string = "folder";
private readonly _ZIP_EXTENSION: string = ".zip";
private readonly _DEPOSIT_FILE_DOWNLOAD_PREFIX: string = "deposit_";
private readonly _FOLDER_QUERY_PARAM: string = "folder";
......
......@@ -24,6 +24,7 @@ import {
ApiService,
defaultUploadStateInitValue,
ENVIRONMENT,
isNotNullNorUndefinedNorWhiteString,
isNullOrUndefined,
LABEL_TRANSLATE,
LabelTranslateInterface,
......@@ -51,6 +52,7 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep
private readonly _CATEGORY_KEY: string = "category";
private readonly _TYPE_KEY: string = "type";
private readonly _FOLDER_KEY: string = "folder";
private readonly _METADATA_TYPE_KEY: string = "metadataType";
private readonly _CHECKSUM_MD5: string = "checksumMd5";
private readonly _CHECKSUM_MD5_ORIGIN: string = "checksumMd5Origin";
private readonly _CHECKSUM_SHA1: string = "checksumSha1";
......@@ -85,6 +87,9 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep
if (!action.isArchive) {
formData.append(this._FOLDER_KEY, isNullOrUndefined(fileUploadWrapper.subDirectory) ? StringUtil.stringEmpty : fileUploadWrapper.subDirectory);
}
if (isNotNullNorUndefinedNorWhiteString(fileUploadWrapper.metadataType)) {
formData.append(this._METADATA_TYPE_KEY, fileUploadWrapper.metadataType);
}
formData.append(this._FILE_KEY, fileUploadWrapper.file, fileUploadWrapper.file.name);
formData.append(this._CATEGORY_KEY, fileUploadWrapper.dataCategory);
formData.append(this._TYPE_KEY, fileUploadWrapper.dataType);
......
Supports Markdown
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