diff options
Diffstat (limited to 'ui/imports/api/scheduled-scans')
-rw-r--r-- | ui/imports/api/scheduled-scans/scheduled-scans.js | 3 | ||||
-rw-r--r-- | ui/imports/api/scheduled-scans/server/publications.js | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/ui/imports/api/scheduled-scans/scheduled-scans.js b/ui/imports/api/scheduled-scans/scheduled-scans.js index 54d4565..4d06a33 100644 --- a/ui/imports/api/scheduled-scans/scheduled-scans.js +++ b/ui/imports/api/scheduled-scans/scheduled-scans.js @@ -54,7 +54,6 @@ let schema = new SimpleSchema({ }, scheduled_timestamp: { type: Date, - defaultValue: null, optional: true, } }); @@ -81,3 +80,5 @@ export const subsScheduledScansPageAmountSorted = 'scheduled_scans?page&amount&s export const subsScheduledScansPageAmountSortedCounter = `${subsScheduledScansPageAmountSorted}!counter`; export const subsScheduledScansId = 'scheduled_scans?_id'; + +export const subsScheduledScansEnv = 'scheduled_scans?env'; diff --git a/ui/imports/api/scheduled-scans/server/publications.js b/ui/imports/api/scheduled-scans/server/publications.js index 9359c20..f4c5b9b 100644 --- a/ui/imports/api/scheduled-scans/server/publications.js +++ b/ui/imports/api/scheduled-scans/server/publications.js @@ -2,10 +2,12 @@ import { Meteor } from 'meteor/meteor'; import * as R from 'ramda'; import { Counts } from 'meteor/tmeasday:publish-counts'; -import { ScheduledScans, +import { + ScheduledScans, subsScheduledScansPageAmountSorted, subsScheduledScansPageAmountSortedCounter, subsScheduledScansId, + subsScheduledScansEnv, } from '../scheduled-scans.js'; Meteor.publish(subsScheduledScansPageAmountSorted, function ( @@ -24,7 +26,7 @@ Meteor.publish(subsScheduledScansPageAmountSorted, function ( let sortParams = {}; sortParams = R.ifElse(R.isNil, R.always(sortParams), - R.assoc(R.__, sortDirection, sortParams))(sortField); + R.assoc(R.__, sortDirection, sortParams))(sortField); console.log('sort params:', sortParams); @@ -50,3 +52,13 @@ Meteor.publish(subsScheduledScansId, function (_id) { let query = { _id: _id }; return ScheduledScans.find(query); }); + +Meteor.publish(subsScheduledScansEnv, function (env) { + console.log(`server subscribtion: ${subsScheduledScansEnv}`); + console.log('-env: ', env); + + //let that = this; + + let query = { environment: env }; + return ScheduledScans.find(query); +}); |