Skip to content

Commit 3c472f7

Browse files
Merge pull request #14 from fuzicast/master
Updated collection.load to accept workspace_handle
2 parents 1fbbb59 + 3a24e3b commit 3c472f7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/collection.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,13 @@ Collection.load = function*(args) {
201201

202202
var id = args.id;
203203
var name = args.name;
204+
var workspace_handle = args.workspace_handle;
204205

205206
var criteria = {};
206207

207208
if (id) { criteria.id = id; }
208209
if (name) { criteria.name = name; }
210+
if (workspace_handle) { criteria.workspace_handle = workspace_handle; }
209211

210212
var data = yield models.collections
211213
.find({ where: criteria })

routes/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports.initialize = function(app) {
2020
var data = req.body;
2121
var user_id = api.user.id;
2222

23-
var collection = yield Collection.load({ name: collection_name });
23+
var collection = yield Collection.load({ name: collection_name, workspace_handle: workspace.handle });
2424

2525
if (!collection) return res.json(404, {
2626
message: "couldn't find collection",

0 commit comments

Comments
 (0)