Merge branch '15610-large-collection-perf-fix'
[arvados-workbench2.git] / src / services / collection-service / collection-service-files-response.ts
index f3a2147e26c5810705282d7abd322845508ce66c..5e6f7b83f0ecf7628546ce5101dd75c7e52f6629 100644 (file)
@@ -35,22 +35,21 @@ export const extractFilesData = (document: Document) => {
                 .replace(collectionUrlPrefix, '')
                 .replace(nameSuffix, '');
 
-
+            const parentPath = directory.replace(/\/$/, '');
             const data = {
                 url,
                 id: [
                     collectionUuid ? collectionUuid : '',
-                    directory ? '/' + directory.replace(/^\//, '') : '',
+                    directory ? parentPath : '',
                     '/' + name
                 ].join(''),
                 name,
-                path: directory,
+                path: parentPath,
             };
 
             return getTagValue(element, 'D:resourcetype', '')
                 ? createCollectionDirectory(data)
                 : createCollectionFile({ ...data, size });
-
         });
 };