-
Notifications
You must be signed in to change notification settings - Fork 0
/
load-cities.js
33 lines (26 loc) · 954 Bytes
/
load-cities.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const rowMaker = (tick, second) => {
return getDataRow(tick);
}
const jobInformation = () => {
return {
jobType: 'insert',
targetTable: 'cities',
PK: 'city',
description: 'Load initial city data',
items: 4
};
}
function getDataRow(index) {
let data = [
{ city: 'Las Vegas', state: 'NV', pop: 641000, url: 'https://s3.amazonaws.com/my-bucket/photo.jpg' },
{ city: 'Seattle', state: 'WA', pop: 737000, url: 'https://s3.amazonaws.com/my-bucket/photo.jpg' },
{ city: 'Boston', state: 'MA', pop: 650000, url: 'https://s3.amazonaws.com/my-bucket/photo.jpg' },
{ city: 'Wakefield', state: 'MA', pop: 28000, url: 'https://s3.amazonaws.com/my-bucket/photo.jpg' }
];
if(!index || index > data.length) {
console.log('error, data index out of range');
} else {
return data[index-1];
}
}
module.exports = { rowMaker, jobInformation };