]);
}
+ create(data?: Partial<CollectionResource>) {
+ return super.create({ ...data, preserveVersion: true });
+ }
+
+ update(uuid: string, data: Partial<CollectionResource>) {
+ return super.update(uuid, { ...data, preserveVersion: true });
+ }
+
async files(uuid: string) {
const request = await this.webdavClient.propfind(`c=${uuid}`);
if (request.responseXML != null) {
await this.webdavClient.delete(`c=${path}`);
}
}
+ await this.update(collectionUuid, { preserveVersion: true });
}
async uploadFiles(collectionUuid: string, files: File[], onProgress?: UploadProgress) {
+ if (collectionUuid === "" || files.length === 0) { return; }
// files have to be uploaded sequentially
for (let idx = 0; idx < files.length; idx++) {
await this.uploadFile(collectionUuid, files[idx], idx, onProgress);
}
+ await this.update(collectionUuid, { preserveVersion: true });
}
- moveFile(collectionUuid: string, oldPath: string, newPath: string) {
- return this.webdavClient.move(
+ async moveFile(collectionUuid: string, oldPath: string, newPath: string) {
+ await this.webdavClient.move(
`c=${collectionUuid}${oldPath}`,
`c=${collectionUuid}${encodeURI(newPath)}`
);
+ await this.update(collectionUuid, { preserveVersion: true });
}
extendFileURL = (file: CollectionDirectory | CollectionFile) => {