aloux-iam 0.0.22 → 0.0.24
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/lib/controllers/user.js +4 -4
- package/lib/models/User.js +1 -1
- package/package.json +1 -1
- package/package-lock.json +0 -4521
package/lib/controllers/user.js
CHANGED
|
@@ -62,13 +62,13 @@ self.get = async (req, res) => {
|
|
|
62
62
|
|
|
63
63
|
// Valida que los modelos existan hantes de hacer una consulta con populate
|
|
64
64
|
if (mongoose.modelNames().includes('Business') && mongoose.modelNames().includes('Client')) {
|
|
65
|
-
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" },{ path: "_business" }, { path: "_client" }]).select("-pwd
|
|
65
|
+
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" },{ path: "_business" }, { path: "_client" }]).select("-pwd").lean()
|
|
66
66
|
}else if(mongoose.modelNames().includes('Business')){
|
|
67
|
-
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" },{ path: "_business" }]).select("-pwd
|
|
67
|
+
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" },{ path: "_business" }]).select("-pwd").lean()
|
|
68
68
|
}else if(mongoose.modelNames().includes('Client')){
|
|
69
|
-
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" }, { path: "_client" }]).select("-pwd
|
|
69
|
+
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" }, { path: "_client" }]).select("-pwd").lean()
|
|
70
70
|
} else{
|
|
71
|
-
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" }]).select("-pwd
|
|
71
|
+
user = await User.findOne({ _id }, { pwd: 0 }).populate([{ path: "_functions" }]).select("-pwd").lean()
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
|
package/lib/models/User.js
CHANGED
|
@@ -11,7 +11,7 @@ const adminSchema = mongoose.Schema({
|
|
|
11
11
|
phone: { type: String, trim: true, maxLength: 13 },
|
|
12
12
|
phoneObj: {
|
|
13
13
|
e164: { type: String, trim: true, maxLength: 13 },
|
|
14
|
-
input: { type: String, trim: true, maxLength:
|
|
14
|
+
input: { type: String, trim: true, maxLength: 12 },
|
|
15
15
|
international: { type: String, trim: true, maxLength: 20 },
|
|
16
16
|
national: { type: String, trim: true, maxLength: 13 },
|
|
17
17
|
rfc3966: { type: String, trim: true, maxLength: 30 },
|