Fix in IPGeocode (download, and fallback). Schema improvements

This commit is contained in:
vjrj 2018-01-11 12:28:55 +01:00
parent 67a2dfbd42
commit df05b33e82
6 changed files with 77 additions and 11 deletions

View file

@ -121,7 +121,7 @@ Meteor.publish('activefiresmyloc', function activeInMyLoc(zoom, lat, lng, height
if (lat && lng) {
return activefires(zoom, lat, lng, height, width);
}
const location = localize();
const geo = localize();
// console.log(`${location.latitude}, ${location.longitude}`);
return activefires(zoom, location.latitude, location.longitude, height, width);
return activefires(zoom, geo.location.latitude, geo.location.longitude, height, width);
});

View file

@ -1,7 +1,9 @@
/* eslint-disable consistent-return */
/* eslint-disable import/no-absolute-path */
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
const Subscriptions = new Mongo.Collection('subscriptions', { idGeneration: 'MONGO' });
@ -74,8 +76,11 @@ Subscriptions.schema = new SimpleSchema({
'location.lon': Number,
geo: LocationSchema,
distance: Number,
chatId: { type: Number, optional: true }, // only in 'telegram' type
owner: String,
type: String
type: String,
createdAt: defaultCreatedAt,
updatedAt: defaultUpdateAt
});
Subscriptions.attachSchema(Subscriptions.schema);

View file

@ -1,5 +1,6 @@
/* eslint-disable consistent-return */
/* eslint-disable import/no-absolute-path */
import { Meteor } from 'meteor/meteor';
import SimpleSchema from 'simpl-schema';
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
@ -105,7 +106,7 @@ const schemaUser = new SimpleSchema({
'name.first': String,
'name.last': String, */
lang: { type: String, optional: true },
telegramChatId: { type: Number, optional: true },
telegramChatId: { type: SimpleSchema.Integer, optional: true },
telegramUsername: { type: String, optional: true },
telegramFirstName: { type: String, optional: true },
telegramLanguageCode: { type: String, optional: true },