trim slashes

This commit is contained in:
Kyle Spearrin 2019-02-26 16:45:26 -05:00
parent 79c15a1841
commit dd2be22351
2 changed files with 4 additions and 4 deletions

View File

@ -107,8 +107,8 @@ export class CollectionService implements CollectionServiceAbstraction {
const collectionCopy = new CollectionView(); const collectionCopy = new CollectionView();
collectionCopy.id = c.id; collectionCopy.id = c.id;
collectionCopy.organizationId = c.organizationId; collectionCopy.organizationId = c.organizationId;
ServiceUtils.nestedTraverse(nodes, 0, c.name.split(NestingDelimiter), collectionCopy, ServiceUtils.nestedTraverse(nodes, 0, c.name.replace(/^\/+|\/+$/g, '').split(NestingDelimiter),
null, NestingDelimiter); collectionCopy, null, NestingDelimiter);
}); });
return nodes; return nodes;
} }

View File

@ -105,8 +105,8 @@ export class FolderService implements FolderServiceAbstraction {
const folderCopy = new FolderView(); const folderCopy = new FolderView();
folderCopy.id = f.id; folderCopy.id = f.id;
folderCopy.revisionDate = f.revisionDate; folderCopy.revisionDate = f.revisionDate;
ServiceUtils.nestedTraverse(nodes, 0, f.name.split(NestingDelimiter), folderCopy, ServiceUtils.nestedTraverse(nodes, 0, f.name.replace(/^\/+|\/+$/g, '').split(NestingDelimiter),
null, NestingDelimiter); folderCopy, null, NestingDelimiter);
}); });
return nodes; return nodes;
} }