@steedos/service-rest 2.7.0 → 2.7.1-beta.2

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": "@steedos/service-rest",
3
- "version": "2.7.0",
3
+ "version": "2.7.1-beta.2",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -16,9 +16,9 @@
16
16
  "repository": {},
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@steedos/objectql": "2.7.0",
20
- "@steedos/service-object-mixin": "2.7.0",
19
+ "@steedos/objectql": "2.7.1-beta.2",
20
+ "@steedos/service-object-mixin": "2.7.1-beta.2",
21
21
  "lodash": "^4.17.21"
22
22
  },
23
- "gitHead": "2f1586ea4f8af5b93753878e96f1f48adbef31a7"
23
+ "gitHead": "1d02bc68fd5dcb00731fffa27684f187c7448b57"
24
24
  }
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2023-03-23 15:12:14
4
- * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
- * @LastEditTime: 2024-04-18 10:48:25
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2024-04-25 16:54:55
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -218,6 +218,11 @@ module.exports = {
218
218
  }
219
219
  const params = ctx.params
220
220
  const { objectName, filters, top, skip, sort } = params
221
+
222
+ if(objectName === 'users'){
223
+ throw new Error("not find object users")
224
+ }
225
+
221
226
  const userSession = ctx.meta.user;
222
227
 
223
228
  let fields = [];
package/translate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: baozhoutao@steedos.com
3
3
  * @Date: 2024-02-26 13:29:53
4
- * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
- * @LastEditTime: 2024-03-12 17:32:17
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2024-04-25 17:16:06
6
6
  * @Description:
7
7
  */
8
8
  const _ = require('lodash')
@@ -394,7 +394,9 @@ async function translateRecordToExpand(record, objectName, expandFields, userSes
394
394
  if (refField && refField != '_id' && refTo != 'users' && refTo != 'spaces' && spaceId) {
395
395
  queryFilters.push(["space", "=", spaceId])
396
396
  }
397
-
397
+ if(refTo === 'users'){
398
+ queryFields = ['_id', 'name']
399
+ }
398
400
  let refRecords = await refObj.find({
399
401
  filters: queryFilters,
400
402
  fields: queryFields,