assisweb 5.0.0 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +14 -5
- package/package.json +1 -1
package/index.js
CHANGED
@@ -18,11 +18,20 @@ const registerSchema = new mongoose.Schema({
|
|
18
18
|
})
|
19
19
|
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
module.exports.Accounts = Accounts = mongoose.model("Accounts" , registerSchema)
|
23
22
|
module.exports = {
|
24
|
-
UserData : function(Email , Type) {
|
25
|
-
|
26
|
-
|
23
|
+
UserData : async function(Email , Type) {
|
24
|
+
await Accounts.findOne({MyEmail: Email} , (err , data) => {
|
25
|
+
if(err) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
|
29
|
+
if(data) {
|
30
|
+
if(Type === "Name")return data.MyName
|
31
|
+
if(Type === "Email")return data.MyEmail
|
32
|
+
if(Type === "ID")return data.MyID
|
33
|
+
}else return console.log("Assis Error : Email Not Found")
|
34
|
+
|
35
|
+
})
|
27
36
|
}
|
28
37
|
}
|