Fixes graph saving.
authordsc <dsc@wikimedia.org>
Thu, 29 Mar 2012 13:27:52 +0000 (06:27 -0700)
committerdsc <dsc@wikimedia.org>
Thu, 29 Mar 2012 13:27:52 +0000 (06:27 -0700)
lib/server/server.co

index a791145..cec9568 100755 (executable)
@@ -131,7 +131,7 @@ app.configure ->
 app.get '/', (req, res) ->
     res.render 'dashboard'
 
-app.post '/graph/save', (req, res, next) ->
+saveGraph = (req, res, next) ->
     if not req.body
         return res.send {result:"error", message:"JSON required!"}, 501
     
@@ -150,6 +150,9 @@ app.post '/graph/save', (req, res, next) ->
         res.send { result:"ok" }
 
 
+app.post '/graph/save', saveGraph
+app.put '/graph/:slug\.json', saveGraph
+
 app.get '/graph/:slug\.json', (req, res, next) ->
     req.url .= replace /^\/graph\//i, '/presets/'
     next()