@go-mailer/jarvis 5.0.2 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/query.js
CHANGED
|
@@ -178,8 +178,9 @@ const generatePipeline = ({ group_by, seek_conditions, sort_condition, sum, fiel
|
|
|
178
178
|
$match: { ...seek_conditions }
|
|
179
179
|
})
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
let sort_options = sort_condition
|
|
182
|
+
if (sort_condition && typeof(sort_condition) === 'string') {
|
|
183
|
+
sort_options = sort_condition.split(' ').reduce((sac, condition) => {
|
|
183
184
|
let key = condition
|
|
184
185
|
let value = 1
|
|
185
186
|
if (key.includes('-')) {
|
|
@@ -189,7 +190,9 @@ const generatePipeline = ({ group_by, seek_conditions, sort_condition, sum, fiel
|
|
|
189
190
|
|
|
190
191
|
return { ...sac, [key]: value }
|
|
191
192
|
}, {})
|
|
193
|
+
}
|
|
192
194
|
|
|
195
|
+
if (sort_options && Object.keys(sort_options).length) {
|
|
193
196
|
pipeline.push({
|
|
194
197
|
$sort: { ...sort_options }
|
|
195
198
|
})
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
const { CampaignSchema } = require('./Campaign')
|
|
2
1
|
const { ContactImportSchema } = require('./Contact')
|
|
3
2
|
const { PostalSchema } = require('./Postal')
|
|
4
3
|
const { TaskSchema } = require('./automation/Task')
|
|
4
|
+
const { CampaignSchema } = require('./mailing/Campaign')
|
|
5
|
+
const { MailActionSchema } = require('./mailing/Mailaction')
|
|
5
6
|
|
|
6
7
|
module.exports = {
|
|
7
8
|
CampaignSchema,
|
|
8
9
|
ContactImportSchema,
|
|
10
|
+
MailActionSchema,
|
|
9
11
|
PostalSchema,
|
|
10
12
|
AutomationTaskSchema: TaskSchema
|
|
11
13
|
}
|
package/package.json
CHANGED
|
File without changes
|