Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
weather
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jay J Kim
weather
Commits
19e18742
Commit
19e18742
authored
Aug 31, 2016
by
Zach Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap the data insert in a function to call it later
probably gonna need to do more with this
parent
2bdc3c5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
weather/imports/api/data.js
weather/imports/api/data.js
+15
-13
No files found.
weather/imports/api/data.js
View file @
19e18742
...
...
@@ -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
(),
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment