Android api asynced

This commit is contained in:
Vincze József 2025-02-19 15:27:24 +01:00
parent 2af3777a42
commit c717d2b79a
2 changed files with 6 additions and 20 deletions

16
app.js
View File

@ -411,16 +411,8 @@ app.post('/apiRegisterDevice',function(req,res){
}) })
}) })
app.get('/apiemployee/:apiKey',function(req,res){ app.get('/apiemployee/:apiKey', async function(req,res){
apiEmployee(req.params.apiKey,function(err,w){ var w=await apiEmployee(req.params.apiKey)//,function(err,w){
if (err)
{
res.setHeader('Content-Type', 'application/json');
res.send(err);
}
else
{
if (w){ if (w){
res.setHeader('Content-Type', 'application/json'); res.setHeader('Content-Type', 'application/json');
res.send(w); res.send(w);
@ -430,8 +422,8 @@ app.get('/apiemployee/:apiKey',function(req,res){
//res.setHeader('Content-Type', 'application/json'); //res.setHeader('Content-Type', 'application/json');
res.sendStatus(401); res.sendStatus(401);
} }
}
})
}) })
app.get('/apiemployeelist/:apiKey',function(req,res){ app.get('/apiemployeelist/:apiKey',function(req,res){
apiGetEmployeeList(req.params.apiKey,function(err,w){ apiGetEmployeeList(req.params.apiKey,function(err,w){

View File

@ -4104,20 +4104,14 @@ router.get('/newPassword/:id', utils.ensureAuthenticated,function (req, res) {
// Get employee list android // Get employee list android
router.get('/androidList/:uid', function (req, res) { router.get('/androidList/:uid', async function (req, res) {
//calling.aFunction(); //calling.aFunction();
androidApi.apiEmployee(req.params.uid,function(err,resp){ var resp=await androidApi.apiEmployee(req.params.uid)//,function(err,resp){
if(err){
console.log(err);
return;
}else{
//sendEmailApiKey(document,apikey.apiKey) //sendEmailApiKey(document,apikey.apiKey)
//console.log(document.name); //console.log(document.name);
res.send(resp); res.send(resp);
}
});
}); });