15672: Fixes warnings
[arvados-workbench2.git] / src / services / collection-files-service / collection-files-service.ts
index 3b320eb6c9780f7bd407ee01ce9be2902d4d313f..f8e7de9857c333d78fd08de5dc8425cf75789552 100644 (file)
@@ -5,7 +5,6 @@
 import { CollectionService } from "../collection-service/collection-service";
 import { parseKeepManifestText, stringifyKeepManifest } from "./collection-manifest-parser";
 import { mapManifestToCollectionFilesTree } from "./collection-manifest-mapper";
-import { CollectionFile } from "../../models/collection-file";
 
 export class CollectionFilesService {
 
@@ -26,19 +25,20 @@ export class CollectionFilesService {
     async renameFile(collectionUuid: string, file: { name: string, path: string }, newName: string) {
         const collection = await this.collectionService.get(collectionUuid);
         const manifest = parseKeepManifestText(collection.manifestText);
-        const updatedManifest = manifest.map(stream =>
-            stream.name === file.path
+        const updatedManifest = manifest.map(
+            stream => stream.name === file.path
                 ? {
                     ...stream,
-                    files: stream.files.map(f =>
-                        f.name === file.name
+                    files: stream.files.map(
+                        f => f.name === file.name
                             ? { ...f, name: newName }
-                            : f)
+                            : f
+                    )
                 }
                 : stream
         );
         const manifestText = stringifyKeepManifest(updatedManifest);
-        return this.collectionService.update(collectionUuid, { ...collection, manifestText });
+        return this.collectionService.update(collectionUuid, { manifestText });
     }
 
     async deleteFile(collectionUuid: string, file: { name: string, path: string }) {
@@ -55,5 +55,4 @@ export class CollectionFilesService {
         const manifestText = stringifyKeepManifest(updatedManifest);
         return this.collectionService.update(collectionUuid, { manifestText });
     }
-
-}
\ No newline at end of file
+}