Fixes graph-list endpoint to work with changes to readJSONFiles
authorDavid Schoonover <dsc@wikimedia.org>
Mon, 16 Jul 2012 19:51:57 +0000 (12:51 -0700)
committerDavid Schoonover <dsc@wikimedia.org>
Mon, 16 Jul 2012 19:51:57 +0000 (12:51 -0700)
src/server/controllers/graph.co

index fa09476..479fe3d 100644 (file)
@@ -49,12 +49,11 @@ class GraphController extends FileBackedController
         # if format is json, then return the graph JSON
         switch req.format
             case 'json' 
-                pattern = "#{@dataDir}/*.json"
                 Seq()
                     # find list of data/graph/*.json files, send back the objects
-                    .seq            -> readJSONFilesAsync pattern, this
-                    # remove filepath info
-                    .seq   (graphs) -> res.send _.values graphs
+                    .seq readJSONFilesAsync, "#{@dataDir}/**", Seq
+                    # remove filepath info from the hash of graphs
+                    .seq -> res.send _.values it
             default 
                 res.render 'graph/index'