Improved rest api calls

This commit is contained in:
vjrj 2018-06-19 00:18:18 +02:00
parent 5b3d86e6a5
commit 5642b106d4
4 changed files with 45 additions and 8 deletions

View file

@ -1,6 +1,7 @@
/* eslint-disable consistent-return */
/* eslint-disable import/no-absolute-path */
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import { defaultCreatedAt, defaultUpdateAt } from '/imports/api/Utility/Utils.js';
@ -42,6 +43,7 @@ Subscriptions.deny({
Subscriptions.schema = new SimpleSchema({
_id: { type: Meteor.Collection.ObjectID, optional: true, blackbox: true },
location: Object,
'location.lat': Number,
'location.lon': Number,

View file

@ -12,6 +12,7 @@ function geo(doc) {
export function subscriptionsInsert(doc, userId, type) {
check(doc, {
_id: Match.Maybe(Meteor.Collection.ObjectID),
location: Match.ObjectIncluding({ lat: Number, lon: Number }),
distance: Number
});