Skip to content

Commit

Permalink
modified placements #60
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kamel committed Apr 27, 2015
1 parent 1a864d6 commit ae46399
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion DSP
Submodule DSP deleted from 8bfaf8
9 changes: 6 additions & 3 deletions routes/placements.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ var bidder = require('../lib/bidder');
router.route('/')
.post(jsonParser, function(req, res) {
var placement = req.body.placement;
var longitude = req.body.longitude;
var latitude = req.body.latitude;
var publisherId = req.body.publisherId;
var userId = req.body.userId;
bidder(placement).then(function(winningAd) {
var price = winningAd.price;
var budget = winningAd.budget;
var ad = Creative.find(winningAd.id);
var price = ad.price;
var budget = ad.budget;
var newBudget = budget - price;
Impression.create({ creativeID: winningAd.id, publisherID: publisherId, userID: userId,
longitude: winningAd.longitude, latitude: winningAd.latitude, price: price
longitude: longitude, latitude: latitude, price: price
})
res.status(201).json(winningAd);
}, function(err) {
Expand Down

0 comments on commit ae46399

Please sign in to comment.