fix: send raw collections

This commit is contained in:
thecodrr
2020-03-23 15:06:12 +05:00
parent 025a953cea
commit 9439ba7739
6 changed files with 33 additions and 13 deletions

View File

@@ -62,10 +62,14 @@ export default class CachedCollection {
return this.map.get(id);
}
getRaw() {
return Array.from(this.map.values());
}
getAllItems(sortFn = u => u.dateCreated) {
let items = [];
this.map.forEach(value => {
if (value.deleted) return; // if item is deleted we skip it.
if (value.deleted) return;
items[items.length] = value;
});
return sort(items).desc(sortFn);