Skip to content

Commit

Permalink
Add Locations configuration and statuses.
Browse files Browse the repository at this point in the history
  • Loading branch information
kabalin committed Feb 3, 2019
1 parent c6f0a4d commit 2ca6209
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/collections/locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit 2ca6209

Please sign in to comment.