[MNT-22641] Upload versioning improvements (#7300)

* support "versioningEnabled" for uploads

* documentation updates

* remove app config and extend the api docs
This commit is contained in:
Denys Vuika
2021-10-14 15:06:01 +01:00
committed by GitHub
parent a3dc441703
commit 941028999e
4 changed files with 189 additions and 66 deletions

View File

@@ -246,6 +246,10 @@ export class UploadService {
opts.renditions = 'doclib';
}
if (file.options && file.options.versioningEnabled !== undefined) {
opts.versioningEnabled = file.options.versioningEnabled;
}
if (file.options.newVersion === true) {
opts.overwrite = true;
opts.majorVersion = file.options.majorVersion;
@@ -262,11 +266,14 @@ export class UploadService {
if (file.id) {
return this.nodesApi.updateNodeContent(file.id, <any> file.file, opts);
} else {
const nodeBody = { ... file.options };
delete nodeBody['versioningEnabled'];
return this.uploadApi.uploadFile(
file.file,
file.options.path,
file.options.parentId,
file.options,
nodeBody,
opts
);
}