From 2ca6209b52d67a091b34e7661340206df8f032fc Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 29 Sep 2015 23:05:13 +0100 Subject: [PATCH] Add Locations configuration and statuses. --- lib/collections/locations.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/collections/locations.js b/lib/collections/locations.js index f3fd10b..196dc16 100644 --- a/lib/collections/locations.js +++ b/lib/collections/locations.js @@ -111,14 +111,34 @@ locationSchemaObject = { } }; +// Setup global namespace Locations = new Mongo.Collection('locations'); locationSchema = new SimpleSchema(locationSchemaObject); Locations.attachSchema(locationSchema); +// Posts config namespace +Locations.config = {}; +Locations.config.locationStatuses = [ + { + value: 1, + label: function(){return 'pending';} + }, + { + value: 2, + label: function(){return 'approved';} + }, + { + value: 3, + label: function(){return 'rejected';} + } +]; + +// Define allow callback. Locations.allow({ remove: function(userId, location) { return (isAdminUser()); }, }); +// Server side methods. Meteor.methods({ locationInsert: function(locationAttributes) { var locationWithSameLink = Locations.findOne({url: locationAttributes.url});