Improvements in fireMaps. User subs area
This commit is contained in:
parent
f9d60a1685
commit
aced217a7d
4 changed files with 128 additions and 0 deletions
51
imports/api/FireAlerts/FireAlerts.js
Normal file
51
imports/api/FireAlerts/FireAlerts.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* eslint-disable consistent-return */
|
||||
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
|
||||
const FireAlerts = new Mongo.Collection('avisosfuego');
|
||||
|
||||
FireAlerts.allow({
|
||||
insert: () => false,
|
||||
update: () => false,
|
||||
remove: () => false,
|
||||
});
|
||||
|
||||
FireAlerts.deny({
|
||||
insert: () => true,
|
||||
update: () => true,
|
||||
remove: () => true,
|
||||
});
|
||||
|
||||
/* Sample:
|
||||
* "_id" : ObjectId("5a059c4879095a1adba47507"),
|
||||
* "chatId" : null,
|
||||
* "location" : {
|
||||
* "lat" : 40.2324096,
|
||||
* "lon" : -3.3514863,
|
||||
* "text" : null
|
||||
* },
|
||||
* "aviso" : ISODate("2017-11-10T12:32:08.973Z"),
|
||||
* "dateformat" : "20171110",
|
||||
* "geo" : {
|
||||
* "type" : "Point",
|
||||
* "coordinates" : [
|
||||
* -3.3514863,
|
||||
* 40.2324096
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* */
|
||||
|
||||
|
||||
FireAlerts.schema = new SimpleSchema({
|
||||
location: Object,
|
||||
'location.lat': SimpleSchema.Integer,
|
||||
'location.lon': SimpleSchema.Integer,
|
||||
aviso: Date,
|
||||
}
|
||||
);
|
||||
|
||||
FireAlerts.attachSchema(FireAlerts.schema);
|
||||
|
||||
export default FireAlerts;
|
||||
6
imports/api/FireAlerts/server/publications.js
Normal file
6
imports/api/FireAlerts/server/publications.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import FireAlerts from '../FireAlerts';
|
||||
|
||||
Meteor.publish('fireAlerts', function fireAlerts() {
|
||||
return FireAlerts.find();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue