sr-npm 1.0.3 → 1.0.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.
@@ -0,0 +1,5 @@
1
+ export const COLLECTIONS = {
2
+ AMOUNT_OF_JOBS_PER_DEPARTMENT: 'AmountOfJobsPerDepartment',
3
+ CITIES: 'cities',
4
+ JOBS: 'Jobs',
5
+ }
@@ -1,14 +1,17 @@
1
- const { wixData } = require('./elevated-modules');
1
+ //const { wixData } = require('./elevated-modules');
2
+ const { COLLECTIONS } = require('./consts');
3
+ const { items } = require('@wix/data');
2
4
 
3
- async function getAllPositions(collectionID) {
4
- const query = wixData.query(collectionID);
5
+
6
+ async function getAllPositions() {
7
+ const query = items.query(COLLECTIONS.JOBS);
5
8
  const results = await query.find();
6
9
  return results.items;
7
10
 
8
11
  }
9
12
 
10
- async function getPositionsByField(collectionID, field, value) {
11
- const query = wixData.query(collectionID)
13
+ async function getPositionsByField(field, value) {
14
+ const query = items.query(COLLECTIONS.JOBS)
12
15
  .eq(field, value);
13
16
  const results = await query.find();
14
17
  return results.items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {