Skip to content

Commit

Permalink
BC-5268 change alert api to v3 (#3442)
Browse files Browse the repository at this point in the history
* BC-5268 change alert api to v3

---------

Co-authored-by: Tomasz Wiaderek <[email protected]>
  • Loading branch information
wiaderwek and Tomasz Wiaderek authored Apr 29, 2024
1 parent 1d463cb commit 9facea3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let handler = (req, res) => {
if (Configuration.get('FEATURE_ALERTS_ENABLED')) {
handler = (req, res) => AlertsCache.get(req)
.then((alert) => {
res.json(alert);
res.json(alert?.data);
}).catch((err) => {
logger.error(new Error('Can not get /alert', formatError(err)));
res.json([]);
Expand Down
2 changes: 1 addition & 1 deletion helpers/cache/alert.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const api = require('../../api');
const Cache = require('./Cache');

const getAlerts = async (req) => api(req).get('/alert');
const getAlerts = async (req) => api(req, { version: 'v3' }).get('/alert');

const AlertsCache = new Cache(getAlerts, { updateIntervalSecounds: 60 });

Expand Down

0 comments on commit 9facea3

Please sign in to comment.