Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-manager

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-manager - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

19

example/app.js

@@ -8,7 +8,12 @@ var Admin = require('../lib/admin').Admin,

var Artist = require('./models/Artist').Artist;
var models = [
{
model: require('./models/Artist').Artist,
model: Artist,
// the name of the property to be used as label when an Artist is displayed embedded in another document
label: 'name'
label: 'name',
actions: {
'Toggle grammy': toggleGrammy
}
},

@@ -25,2 +30,12 @@ {

function toggleGrammy(req, res, next){
var ids = req.body.ids;
Artist.find().where('_id').in(ids).exec(function(err, artists){
async.each(artists, function(artist, cb){
artist.wonGrammy = !artist.wonGrammy;
artist.save(cb);
}, next);
});
}
var admin = new Admin(models, {

@@ -27,0 +42,0 @@ pageSize: 20

10

lib/routes/documents.js

@@ -51,7 +51,9 @@ var utils = require('../utils'),

if (action){
action.call(action, req, res, next);
} else {
if (!action) return res.redirect('back');
action.call(action, req, res, function(err){
if (err) return res.send(404, err);
res.redirect('back');
}
});
}

@@ -58,0 +60,0 @@

{
"name": "mongoose-manager",
"version": "0.1.6",
"version": "0.1.7",
"scripts": {

@@ -5,0 +5,0 @@ "example": "supervisor --force-watch -i public,views example/app.js"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc