-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3711 from Vizzuality/feature/alerts-latest-dates
Fixed GLAD alerts getLatest and added a fetchFiresLatest method, both…
- Loading branch information
Showing
5 changed files
with
57 additions
and
26 deletions.
There are no files selected for viewing
13 changes: 8 additions & 5 deletions
13
app/javascript/components/widgets/widgets/forest-change/fires-alerts/actions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { fetchFiresAlerts } from 'services/alerts'; | ||
import { fetchFiresAlerts, fetchFiresLatest } from 'services/alerts'; | ||
import axios from 'axios'; | ||
|
||
export default ({ params }) => | ||
fetchFiresAlerts(params).then(alerts => { | ||
const { data } = alerts.data; | ||
return data || {}; | ||
}); | ||
axios.all([fetchFiresAlerts(params), fetchFiresLatest(params)]).then( | ||
axios.spread((alerts, latest) => { | ||
const { data } = alerts.data; | ||
return { alerts: data, latest } || {}; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters