Now also the ip address is passed to the sendRequest function in requestRepository so that the requesters ip address can be logged in the database.
This commit is contained in:
@@ -12,8 +12,9 @@ function submitRequestController(req, res) {
|
|||||||
// This is the id that is the param of the url
|
// This is the id that is the param of the url
|
||||||
const id = req.params.mediaId;
|
const id = req.params.mediaId;
|
||||||
const type = req.query.type;
|
const type = req.query.type;
|
||||||
|
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||||
|
|
||||||
requestRepository.sendRequest(id, type)
|
requestRepository.sendRequest(id, type, ip)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
res.send({ success: true, message: 'Media item sucessfully requested!' });
|
res.send({ success: true, message: 'Media item sucessfully requested!' });
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user