Add files page

This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2018-12-26 00:22:07 -08:00
1 parent f1c3e21ba3
commit 41229ffb85
12 files changed
+521 -8

No files matched your search

+7 -1
View File
@@ -17,7 +17,9 @@ const RESOURCE_DB = {
files: "genieacs"
};
const RESOURCE_COLLECTION = {};
const RESOURCE_COLLECTION = {
files: "fs.files"
};
function getClient() {
if (!_clientPromise)
@@ -91,6 +93,8 @@ function query(resource, filter, options, callback) {
docs = docs.map(d => mongodbFunctions.flattenTask(d));
else if (resource === "presets")
docs = docs.map(d => mongodbFunctions.flattenPreset(d));
else if (resource === "files")
docs = docs.map(d => mongodbFunctions.flattenFile(d));
return resolve(docs);
});
else
@@ -104,6 +108,8 @@ function query(resource, filter, options, callback) {
doc = mongodbFunctions.flattenTask(doc);
else if (resource === "presets")
doc = mongodbFunctions.flattenPreset(doc);
else if (resource === "files")
doc = mongodbFunctions.flattenFile(doc);
callback(doc);
},
err => {