@digione/node-custom-api 0.1.9-beta12 → 0.1.9-beta13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/user.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.1.9-beta12",
3
+ "version": "0.1.9-beta13",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/user.js CHANGED
@@ -317,9 +317,12 @@ const getGroupSetting = (ref, id, { attributes = ['id', 'shared', 'setting'] } =
317
317
  exports.getGroupSetting = getGroupSetting;
318
318
  const getGroupPermission = (ref, id, module, { permission = {}, group_shared = undefined, organ_id = 0, attributes = ['id', 'shared', 'setting'] } = {}) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
319
319
  if (typeof group_shared == "undefined") {
320
- let setting = yield (0, exports.getGroupSetting)(ref, id, { attributes });
321
- if (setting)
322
- group_shared = setting['shared'];
320
+ let group = yield (0, exports.getGroupSetting)(ref, id, { attributes });
321
+ if (group) {
322
+ permission['group_setting'] = group['setting'] || {};
323
+ permission['admin'] = group['shared'];
324
+ group_shared = group['shared'];
325
+ }
323
326
  }
324
327
  if (typeof group_shared != "undefined" && group_shared == 0) {
325
328
  let query = yield group_permission_1.UserGroupPermissionModel.schema(ref, "_").findOne({