Permalink
Browse files

Allow optional :id param for post to model endpoints.

  • Loading branch information...
1 parent e450cb9 commit 49605c4602e52745d3c6ce08b68c4b22b0bc6afb @willwhite willwhite committed Dec 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 servers/Route.bones
View
@@ -82,7 +82,7 @@ server.prototype.initializeModels = function(app) {
this.models = app.models;
_.bindAll(this, 'loadModel', 'getModel', 'saveModel', 'delModel', 'loadCollection');
this.get('/api/:model/:id', [this.loadModel, this.getModel]);
- this.post('/api/:model', [this.loadModel, this.saveModel]);
+ this.post('/api/:model/:id?', [this.loadModel, this.saveModel]);
this.put('/api/:model/:id', [this.loadModel, this.saveModel]);
this.del('/api/:model/:id', [this.loadModel, this.delModel]);
this.get('/api/:collection', this.loadCollection.bind(this));

0 comments on commit 49605c4

Please sign in to comment.