-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/zaavia-team/mobile-attendance
- Loading branch information
Showing
28 changed files
with
804 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"files": { | ||
"main.css": "/static/css/main.e6c13ad2.css", | ||
"main.js": "/static/js/main.d833e689.js", | ||
"main.js": "/static/js/main.0e85d97e.js", | ||
"static/js/787.16cf1214.chunk.js": "/static/js/787.16cf1214.chunk.js", | ||
"index.html": "/index.html", | ||
"main.e6c13ad2.css.map": "/static/css/main.e6c13ad2.css.map", | ||
"main.d833e689.js.map": "/static/js/main.d833e689.js.map", | ||
"main.0e85d97e.js.map": "/static/js/main.0e85d97e.js.map", | ||
"787.16cf1214.chunk.js.map": "/static/js/787.16cf1214.chunk.js.map" | ||
}, | ||
"entrypoints": [ | ||
"static/css/main.e6c13ad2.css", | ||
"static/js/main.d833e689.js" | ||
"static/js/main.0e85d97e.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.d833e689.js"></script><link href="/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Attendence App</title><script defer="defer" src="/static/js/main.0e85d97e.js"></script><link href="/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
const MailSetupRepo = require("../repository/email_repo"); | ||
|
||
exports.CreateMailSetup = (req, res) => { | ||
let ActionDetails = { | ||
ActionTakenByName: req.user.FirstName + " " + req.user.LastName, | ||
ActionTakenByID: req.user._id, | ||
ActionTakenOn: new Date(), | ||
ActionTakenByLoginID: req.user.LoginID, | ||
Designation : req.user.Designation | ||
}; | ||
|
||
let mailSetupObj ={ | ||
SenderName : req.body.senderName, | ||
HOST : req.body.HOST, | ||
CreationDetails: ActionDetails, | ||
Email: req.body.USERID, | ||
Password : req.body.Password | ||
}; | ||
if(req.body.PORT){ | ||
mailSetupObj["PORT"] = req.body.PORT | ||
} | ||
|
||
console.log(JSON.stringify(mailSetupObj)) | ||
console.log(JSON.stringify(ActionDetails)) | ||
|
||
MailSetupRepo.create(mailSetupObj).then((success) =>{ | ||
const mailSetup = success | ||
if(mailSetup.HOST == "Gmail"){ | ||
process.env.Email = mailSetup.UserID | ||
process.env.Password = mailSetup.Password | ||
process.env.Host = mailSetup.HOST | ||
process.env.SenderName = mailSetup.SenderName | ||
console.log("GMail " , mailSetup); | ||
}else{ | ||
process.env.Email = mailSetup.UserID | ||
process.env.Password = mailSetup.Password | ||
process.env.Host = mailSetup.HOST | ||
process.env.Port = mailSetup.PORT | ||
process.env.SenderName = mailSetup.SenderName | ||
|
||
} | ||
res.status(200).json({status : true , data:success}) | ||
}).catch(err =>{ | ||
res.status(500).json({status : false,error :err}) | ||
}) | ||
|
||
}; | ||
|
||
exports.GetMailSetup = (req, res) => { | ||
MailSetupRepo.find({}, true).then((success) =>{ | ||
res.status(200).json({status : true, data:success}) | ||
}).catch(err =>{ | ||
res.status(500).json({status : false,error :err}) | ||
}) | ||
|
||
}; | ||
|
||
exports.UpdateMailSetup = (req, res) => { | ||
let query = {_id : req.body._id}; | ||
let update = {$set : {...req.body}}; | ||
update["$set"]["Email"] = req.body.USERID | ||
update["$set"]["SenderName"] = req.body.senderName | ||
// delete update["$set"]["Email"] | ||
delete update["$set"]["_id"] | ||
if(update["$set"]["HOST"] === "Gmail"){ | ||
update["$set"]['PORT'] = "" | ||
} | ||
else update["$set"]["PORT"] = req.body.PORT | ||
console.log(update, "update<----") | ||
console.log(query, "querye<----") | ||
MailSetupRepo.updateOne(query, update).then((success) =>{ | ||
res.status(200).json({status : true , success}) | ||
}).catch(err =>{ | ||
console.log(err, "err") | ||
res.status(500).json({status : false,error :err}) | ||
}) | ||
MailSetupRepo.find({}, true).then((success) =>{ | ||
const mailSetup = success | ||
if(mailSetup.HOST == "Gmail"){ | ||
process.env.Email = mailSetup.UserID | ||
process.env.Password = mailSetup.Password | ||
process.env.Host = mailSetup.HOST | ||
process.env.SenderName = mailSetup.SenderName | ||
console.log("GMail " , mailSetup); | ||
}else{ | ||
process.env.Email = mailSetup.UserID | ||
process.env.Password = mailSetup.Password | ||
process.env.Host = mailSetup.HOST | ||
process.env.Port = mailSetup.PORT | ||
process.env.SenderName = mailSetup.SenderName | ||
|
||
} | ||
console.log("Set environment and update successfully"); | ||
}).catch(err =>{ | ||
console.log("update but not set in environment " , err); | ||
}) | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const mongoose = require('mongoose'); | ||
const Schema = mongoose.Schema; | ||
const ObjectId = Schema.ObjectId; | ||
|
||
|
||
|
||
const ActionDetails = { | ||
ActionTakenByName: { type: String }, | ||
ActionTakenByID: { type: Schema.ObjectId }, | ||
ActionTakenOn: { type: Date }, | ||
ActionTakenByLoginID: { type: String }, | ||
CardNumber: String | ||
}; | ||
|
||
const MailSchema = new Schema({ | ||
SenderName: String, | ||
HOST : String, | ||
PORT : String, | ||
CreationDetails: ActionDetails, | ||
Email: String, //0 inactive 1 active, | ||
Password : String, | ||
}) | ||
|
||
module.exports = mongoose.model("MailSetup", MailSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.