@digione/node-custom-api 0.2.0-beta4 → 0.2.0-beta5

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.2.0-beta4",
3
+ "version": "0.2.0-beta5",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/stream.js CHANGED
@@ -685,7 +685,7 @@ class StreamUtil {
685
685
  if (field_data['choose_stream']) {
686
686
  let stream = yield stream_1.StreamModel.schema(this.ref, "_").findOne({ where: { id: field_data['choose_stream'] }, raw: true, attributes: ['stream_slug', 'stream_namespace'] });
687
687
  if (stream) {
688
- item['stream'] = yield this.findField(stream['stream_slug'], stream['stream_namespace'], { field_only: true, convert_option: true });
688
+ item['stream'] = yield this.findField(stream['stream_slug'], stream['stream_namespace'], { option, lang_code, field_only: true, convert_option: true });
689
689
  }
690
690
  }
691
691
  }
@@ -104,8 +104,9 @@ const fileService = (setup, { userfiles = false, required = false, fileSize = 0,
104
104
  }
105
105
  let option = setup(validate);
106
106
  let upload = userfiles ? option.array("userfiles", maxCount) : option.any();
107
+ let schema = userfiles ? { tags: Joi.array().allow('', null).items(Joi.object().keys({ slug: Joi.string(), type: Joi.string() })) } : { tags: Joi.any() };
107
108
  return upload(req, res, (err) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
108
- return (0, exports.validateService)(Joi.object().keys({ tags: Joi.array().allow('', null).items(Joi.object().keys({ slug: Joi.string(), type: Joi.string() })) }).unknown(), { field_omit: [] })(req, res, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
109
+ return (0, exports.validateService)(Joi.object().keys(schema).unknown(), { field_omit: [] })(req, res, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
109
110
  try {
110
111
  let field = userfiles ? "userfiles" : undefined;
111
112
  if (err) {