@websy/websy-designs 1.9.9 → 1.9.11

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.
@@ -256,7 +256,12 @@ function ShopRoutes (dbHelper, engine, app) {
256
256
  for (let key in basket.items) {
257
257
  basket.items[key] = sanitizeItem(basket.items[key])
258
258
  }
259
- sql += `, items = '${JSON.stringify(basket.items)}' `
259
+ if (typeof basket.items === 'string') {
260
+ sql += `, items = '${basket.items}' `
261
+ }
262
+ else {
263
+ sql += `, items = '${JSON.stringify(basket.items)}' `
264
+ }
260
265
  }
261
266
  else {
262
267
  sql += `, meta = '${JSONSafeWrite(JSON.stringify(basket.meta))}' `
@@ -268,8 +273,12 @@ function ShopRoutes (dbHelper, engine, app) {
268
273
  }
269
274
  else {
270
275
  // insert
276
+ let itemString = basket.items
277
+ if (typeof itemString !== 'string') {
278
+ itemString = JSON.stringify(basket.items)
279
+ }
271
280
  const sql = `
272
- INSERT INTO ${req.params.basketCompare} (userid, items, meta) VALUES ('${req.session.user.id}', '${JSON.stringify(basket.items)}', '${JSONSafeWrite(JSON.stringify(basket.meta))}')
281
+ INSERT INTO ${req.params.basketCompare} (userid, items, meta) VALUES ('${req.session.user.id}', '${itemString}', '${JSONSafeWrite(JSON.stringify(basket.meta))}')
273
282
  `
274
283
  dbHelper.execute(sql).then(result => {
275
284
  resolve()
@@ -9627,11 +9627,11 @@ class WebsyKPI {
9627
9627
  const DEFAULTS = {
9628
9628
  tooltip: {},
9629
9629
  label: {},
9630
- value: {},
9631
- subValue: {}
9630
+ value: {}
9632
9631
  }
9633
9632
  this.elementId = elementId
9634
9633
  this.options = Object.assign({}, DEFAULTS, options)
9634
+ this.render()
9635
9635
  }
9636
9636
  render (options) {
9637
9637
  this.options = Object.assign({}, this.options, options)
@@ -9641,7 +9641,7 @@ class WebsyKPI {
9641
9641
  if (!this.options.value.classes) {
9642
9642
  this.options.value.classes = []
9643
9643
  }
9644
- if (!this.options.subValue.classes) {
9644
+ if (this.options.subValue && !this.options.subValue.classes) {
9645
9645
  this.options.subValue.classes = []
9646
9646
  }
9647
9647
  if (!this.options.tooltip.classes) {
@@ -9100,11 +9100,11 @@ var WebsyKPI = /*#__PURE__*/function () {
9100
9100
  var DEFAULTS = {
9101
9101
  tooltip: {},
9102
9102
  label: {},
9103
- value: {},
9104
- subValue: {}
9103
+ value: {}
9105
9104
  };
9106
9105
  this.elementId = elementId;
9107
9106
  this.options = _extends({}, DEFAULTS, options);
9107
+ this.render();
9108
9108
  }
9109
9109
  _createClass(WebsyKPI, [{
9110
9110
  key: "render",
@@ -9116,7 +9116,7 @@ var WebsyKPI = /*#__PURE__*/function () {
9116
9116
  if (!this.options.value.classes) {
9117
9117
  this.options.value.classes = [];
9118
9118
  }
9119
- if (!this.options.subValue.classes) {
9119
+ if (this.options.subValue && !this.options.subValue.classes) {
9120
9120
  this.options.subValue.classes = [];
9121
9121
  }
9122
9122
  if (!this.options.tooltip.classes) {