Fix bugs in resources download
Fix a bug caused when downloading with smart query filter on. Also fix a bug in downloading presets.
This commit is contained in:
1 parent
3b3369a236
commit
d70263e798
7 files changed
+26
-22
No files matched your search
+9
-5
@@ -101,11 +101,15 @@ export function query(
|
||||
.collection(RESOURCE_COLLECTION[resource] || resource);
|
||||
const cursor = collection.find(q);
|
||||
if (options.projection) {
|
||||
cursor.project(
|
||||
resource === "devices"
|
||||
? mongodbFunctions.processDeviceProjection(options.projection)
|
||||
: options.projection
|
||||
);
|
||||
let projection = options.projection;
|
||||
if (resource === "devices") {
|
||||
projection = mongodbFunctions.processDeviceProjection(
|
||||
options.projection
|
||||
);
|
||||
}
|
||||
|
||||
if (resource === "presets") projection.configurations = 1;
|
||||
cursor.project(projection);
|
||||
}
|
||||
|
||||
if (resource === "users") cursor.project({ password: 0 });
|
||||
|
||||
Reference in new issue
Block a user