@digione/node-custom-api 0.1.9-beta14 → 0.1.9-beta15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.1.9-beta14",
3
+ "version": "0.1.9-beta15",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/db.js CHANGED
@@ -37,7 +37,7 @@ const genWhere = (where = {}, { as = "", delimiter = ".", prefix = true, bracket
37
37
  let rawWhere = (Object.keys(where).concat(symbolKeys)).reduce((result, key) => {
38
38
  let value = where[key];
39
39
  if (typeof value !== 'undefined') {
40
- key = typeof (key) == "string" ? keyPrefix + "`" + key + "`" : key;
40
+ key = typeof (key) == "string" ? keyPrefix + "`" + (key.split('.').join("`.`")) + "`" : key;
41
41
  if (typeof (value) == "string") {
42
42
  value = SqlString.escape(value);
43
43
  }
package/utils/stream.js CHANGED
@@ -783,7 +783,7 @@ class StreamUtil {
783
783
  if (id_stream && (streams && streams.length)) {
784
784
  let file_id = [];
785
785
  yield Promise.all(streams.map(({ field_type, field_slug, field_data }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
786
- if (field_type == "multiple" && field_data && field_data['choose_stream']) {
786
+ if (field_type == "multiple" && field_data && field_data['choose_stream'] && field_data['self_table'] != "yes") {
787
787
  let stream = yield stream_1.StreamModel.schema(this.ref, "_").findOne({ where: { id: field_data['choose_stream'] }, raw: true, attributes: ['stream_slug', 'stream_prefix'] });
788
788
  let table_f = stream['stream_prefix'] ? stream['stream_prefix'] + stream['stream_slug'] : stream['stream_slug'];
789
789
  yield (0, db_1.remove)(this.ref, `${table}_${table_f}`, { where: { row_id: id } });