Commit 19e18742 authored by Zach Knox's avatar Zach Knox

Wrap the data insert in a function to call it later

probably gonna need to do more with this
parent 2bdc3c5f
......@@ -3,17 +3,19 @@ import { Mongo } from 'meteor/mongo';
export const WeatherData = new Mongo.Collection('weather-data');
for(var key in LOCATIONS) {
const current = LOCATIONS[key];
var currentData
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
currentData = res
});
WeatherData.insert ({
name: current.name,
lat: current.lat,
long: current.long,
data: currentData,
lastUpdated: new Date(),
});
export function refreshData() {
for(var key in LOCATIONS) {
const current = LOCATIONS[key];
var currentData
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
currentData = res
});
WeatherData.insert ({
name: current.name,
lat: current.lat,
long: current.long,
data: currentData,
lastUpdated: new Date(),
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment