@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 +4 -4
- package/package.service.js +7 -2
- package/translate.js +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-rest",
|
|
3
|
-
"version": "2.7.
|
|
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.
|
|
20
|
-
"@steedos/service-object-mixin": "2.7.
|
|
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": "
|
|
23
|
+
"gitHead": "1d02bc68fd5dcb00731fffa27684f187c7448b57"
|
|
24
24
|
}
|
package/package.service.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 2023-03-23 15:12:14
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime: 2024-04-
|
|
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:
|
|
5
|
-
* @LastEditTime: 2024-
|
|
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,
|