@websy/websy-designs 1.12.1 → 1.12.3

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.
@@ -41,7 +41,8 @@ class APIService {
41
41
  constructor (baseUrl = '', options = {}) {
42
42
  this.baseUrl = baseUrl
43
43
  this.options = Object.assign({}, {
44
- fieldValueSeparator: ':'
44
+ fieldValueSeparator: ':',
45
+ whereValueSeparator: ';'
45
46
  }, options)
46
47
  }
47
48
  add (entity, data, options = {}) {
@@ -55,7 +56,7 @@ class APIService {
55
56
  if (id) {
56
57
  query.push(`id${this.options.fieldValueSeparator}${id}`)
57
58
  }
58
- return `${this.baseUrl}/${entity}${query.length > 0 ? `${entity.indexOf('?') === -1 ? '?' : '&'}where=${query.join(';')}` : ''}`
59
+ return `${this.baseUrl}/${entity}${query.length > 0 ? `${entity.indexOf('?') === -1 ? '?' : '&'}where=${query.join(this.options.whereValueSeparator)}` : ''}`
59
60
  }
60
61
  delete (entity, id) {
61
62
  const url = this.buildUrl(entity, id)
@@ -2497,7 +2498,7 @@ class WebsyForm {
2497
2498
  }
2498
2499
  for (let key in d) {
2499
2500
  this.options.fields.forEach(f => {
2500
- if (f.field === key) {
2501
+ if (f.field === key && d[key]) {
2501
2502
  this.setValue(key, d[key])
2502
2503
  // f.value = d[key]
2503
2504
  // const el = document.getElementById(`${this.elementId}_input_${f.field}`)
@@ -58,7 +58,8 @@ var APIService = /*#__PURE__*/function () {
58
58
  _classCallCheck(this, APIService);
59
59
  this.baseUrl = baseUrl;
60
60
  this.options = _extends({}, {
61
- fieldValueSeparator: ':'
61
+ fieldValueSeparator: ':',
62
+ whereValueSeparator: ';'
62
63
  }, options);
63
64
  }
64
65
  _createClass(APIService, [{
@@ -77,7 +78,7 @@ var APIService = /*#__PURE__*/function () {
77
78
  if (id) {
78
79
  query.push("id".concat(this.options.fieldValueSeparator).concat(id));
79
80
  }
80
- return "".concat(this.baseUrl, "/").concat(entity).concat(query.length > 0 ? "".concat(entity.indexOf('?') === -1 ? '?' : '&', "where=").concat(query.join(';')) : '');
81
+ return "".concat(this.baseUrl, "/").concat(entity).concat(query.length > 0 ? "".concat(entity.indexOf('?') === -1 ? '?' : '&', "where=").concat(query.join(this.options.whereValueSeparator)) : '');
81
82
  }
82
83
  }, {
83
84
  key: "delete",
@@ -2476,7 +2477,7 @@ var WebsyForm = /*#__PURE__*/function () {
2476
2477
  }
2477
2478
  var _loop = function _loop(key) {
2478
2479
  _this18.options.fields.forEach(function (f) {
2479
- if (f.field === key) {
2480
+ if (f.field === key && d[key]) {
2480
2481
  _this18.setValue(key, d[key]);
2481
2482
  // f.value = d[key]
2482
2483
  // const el = document.getElementById(`${this.elementId}_input_${f.field}`)