goldstars-services 1.0.7 → 1.0.9
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.
|
@@ -14,14 +14,17 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
14
14
|
* @param {UserModel} query query to populate
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
|
+
|
|
17
18
|
var populateQueryUserData = userQuery => {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
if (!userQuery.isTrainer || !userQuery.isTrainer.clientes) {
|
|
20
|
+
return null; // o devuelve un valor por defecto si prefieres
|
|
21
|
+
}
|
|
22
|
+
return userQuery.populate({
|
|
23
|
+
path: "isTrainer.clientes",
|
|
20
24
|
model: "User",
|
|
21
25
|
select: _queries.QUERY_USER_SELECT
|
|
22
|
-
})
|
|
26
|
+
});
|
|
23
27
|
};
|
|
24
|
-
|
|
25
28
|
/**
|
|
26
29
|
* @description Creates an user and returns it
|
|
27
30
|
* @param {Object} params params for creating the user
|