Replace ServerWithAuth by Server in getFiatRate
To get a fiat rate there is no need to pass by the authentication mechanisms. Also, previously the BWS was waiting for a 'source' in query, but the BWC it is sending a 'provider' query, not 'source', turns out that it is impossible to the client to query a specific provider, because fiatRateService do not recognize the variable 'source'.
This commit is contained in:
parent
752f86029a
commit
ea54fe5a58
|
@ -660,18 +660,22 @@ ExpressApp.prototype.start = function(opts, cb) {
|
|||
});
|
||||
|
||||
router.get('/v1/fiatrates/:code/', function(req, res) {
|
||||
getServerWithAuth(req, res, function(server) {
|
||||
var server;
|
||||
var opts = {
|
||||
code: req.params['code'],
|
||||
source: req.query.source,
|
||||
provider: req.query.provider,
|
||||
ts: +req.query.ts,
|
||||
};
|
||||
try {
|
||||
server = getServer(req, res);
|
||||
} catch (ex) {
|
||||
return returnError(ex, res, req);
|
||||
}
|
||||
server.getFiatRate(opts, function(err, rates) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(rates);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/v1/pushnotifications/subscriptions/', function(req, res) {
|
||||
getServerWithAuth(req, res, function(server) {
|
||||
|
|
Loading…
Reference in New Issue