@cocreate/lazy-loader 1.15.0 → 1.15.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.15.2](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.15.1...v1.15.2) (2024-01-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update to support new query system ([0891371](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/08913711bcbc5d3a86d3d385b916de8da3ad7c45))
7
+
8
+ ## [1.15.1](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.15.0...v1.15.1) (2024-01-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handle apikey error ([85a332a](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/85a332a9ef214a5494c6a5e780778becb15f73b9))
14
+
1
15
  # [1.15.0](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.14.0...v1.15.0) (2024-01-08)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/lazy-loader",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "A simple lazy-loader component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "lazy-loader",
package/src/server.js CHANGED
@@ -135,9 +135,9 @@ class CoCreateLazyLoader {
135
135
 
136
136
  async getApiKey(organization_id, name) {
137
137
  let organization = await this.crud.getOrganization(organization_id, false);
138
- if (!organization.error)
138
+ if (organization.error)
139
139
  return organization.error
140
- else if (!organization.apis)
140
+ if (!organization.apis)
141
141
  return { error: 'Missing apis object in organization object' }
142
142
  if (!organization.apis[name])
143
143
  return { error: `Missing ${name} in organization apis object` }
@@ -207,10 +207,10 @@ async function fetchScriptFromDatabaseAndSave(name, moduleConfig) {
207
207
  host: moduleConfig.object.hostname,
208
208
  array: moduleConfig.array,
209
209
  $filter: {
210
- query: [
211
- { key: "host", value: [moduleConfig.object.hostname, '*'], operator: "$in" },
212
- { key: "pathname", value: moduleConfig.object.pathname, operator: "$eq" }
213
- ],
210
+ query: {
211
+ host: { $in: [moduleConfig.object.hostname, '*'] },
212
+ pathname: moduleConfig.object.pathname
213
+ },
214
214
  limit: 1
215
215
  },
216
216
  organization_id