bajo-extra 0.2.3 → 0.2.5

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.
@@ -19,12 +19,14 @@ async function fetchAndSave ({ source = {}, converter, coll, current = {}, optio
19
19
  try {
20
20
  await recordCreate(coll, r)
21
21
  if (current.coll && current.query) {
22
- const recs = await recordFind(current.coll, current.query)
22
+ const query = await current.query.call(this, r)
23
+ const recs = await recordFind(current.coll, { query })
24
+ const rc = current.converter ? await current.converter.call(this, r, options) : r
23
25
  if (recs.length > 0) {
24
26
  const id = recs[0].id
25
- await recordUpdate(current.coll, id, r)
27
+ await recordUpdate(current.coll, id, rc)
26
28
  } else {
27
- await recordCreate(current.coll, r)
29
+ await recordCreate(current.coll, rc)
28
30
  }
29
31
  }
30
32
  if (options.printCount && (count % options.printCount === 0)) print.succeed(`[${spinner.getElapsed()}] Batch line %d/%d`, count, resp.response.length, { showDatetime: true })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-extra",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Extra package for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {