-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while deleting an object #122
Comments
Body-parser changes 'ids' to 'ids[]' and if there is only one element the type of 'ids[]' is string.
|
I am getting the exact same error when trying to delete models. |
👍
model: var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Types = Schema.Types;
var schema = new Schema({
email: { type: String, unique: true },
password: { type: String }
});
schema.methods.toString = function(){
return this.email;
};
module.exports = schema; express app: var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieSession = require('cookie-session');
var bodyParser = require('body-parser');
var models = require('./models');
var mongoose = require('mongoose');
var formage = require('formage');
var routes = require('./routes/index');
var app = express();
app.set('site', 'My Site');
app.set('secret', 'secret');
app.set('mongo', process.env.MONGOLAB_URI);
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'hjs');
// uncomment after placing your favicon in /public
// app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieSession({secret: app.get('secret'), expires: 604800000}));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
formage.init(app, models, {
title: app.get('site') + ' Admin',
username: process.env.ADMIN_PASSWORD || 'admin',
password: process.env.ADMIN_USER || 'admin',
default_section: 'Configurations',
root: '/admin'
});
// catch 404 and forward to error handler
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
mongoose.connect(app.get('mongo'));
module.exports = app; @refack welcome back 😄 |
So much Balagan On Tue, Jun 23, 2015 at 5:02 PM Alon Valadji [email protected]
|
Issue here as well. |
Looking into it. @robbyoconnor Which ver |
@refack -- formage |
Once node4good/formage#122 is fixed, we will switch to whatever the next release is.
Once node4good/formage#122 is fixed, we will switch to whatever the next release is.
See #140 for a fix. Thank you @DamianRodziewicz! |
Hi,
We get a strange error, which looks like an internal error, while deleting and object with Formage.
Here's what I do:
The error occurs for any of the models.
We're stuck with this error and will appreciate your help. How can we eliminate this error?
We have noticed that Formage uses socket.io internally. We have our own socket.io server running on the same machine -- can this be the reason of the problem?
Environment
var documentSchema = new mongoose.Schema({
definitionId: { type: Number },
userName: { type: String, index: true },
state: { type: Number, enum: [DocumentState.Started, DocumentState.Finished] },
data: mongoose.Schema.Types.Mixed
});
Attachments
The text was updated successfully, but these errors were encountered: