Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
const express = require('express');
const router = express.Router();
const rest = require('../../rest/rest');
router.post('/createUser', (req, res) => {
rest.postResource(process.env.END_POINT_BASE_URI + process.env.EWV_CREATE_USER, req.body)
.then(data => {
res.status(data.response.statusCode).json(data.responseBody);
})
.catch(error => {
console.log('Reports getStations error ', error);
});
});
router.get('/userInfo/:userName', (req, res) => {
const userName = encodeURIComponent(req.params.userName);
const system = req.query.system
// const id = req.params.id;
rest
.getResource(
process.env.END_POINT_BASE_URI +
process.env.EWV_GET_USERDETAILS +
'/' +
userName + `?system=${system}`
)
.then(data => {
// console.log('data from userInfo', data.responseBody);
res.status(data.response.statusCode).json(data.responseBody);
})
.catch(error => {
console.log('Reports getStations error ', error);
});
});
router.post('/userInfo', (req, res) => {
rest
.postResource(
process.env.END_POINT_BASE_URI + process.env.EWV_LIST_ALLUSERS + '/',
req.body
)
.then(data => {
res.status(data.response.statusCode).json(data.responseBody);
})
.catch(error => {
console.log('Ewv admin getUserInfo error ', error);
});
});
//rest call to delete user
router.get('/deleteUserInfo/:userId', (req, res) => {
const userId = req.params.userId;
rest
.getResource(
process.env.END_POINT_BASE_URI + process.env.EWV_DELETE_USER + '/' + userId
)
.then(data => {
res.status(data.response.statusCode).json(data.responseBody);
})
.catch(error => {
console.log('Reports getStations error ', error);
});
});
//Rest Call for Edit USer
router.post('/editUser', (req, res) => {
rest
.postResource(
process.env.END_POINT_BASE_URI + process.env.EWV_EDIT_USER + '/',
req.body
)
.then(data => {
res.status(data.response.statusCode).json(data.responseBody);
})
.catch(error => {
console.log('Reports getStations error ', error);
});
});
module.exports = router;