Add root true to remote methods
This commit is contained in:
parent
d3eed3b321
commit
8a7086be5c
|
@ -107,6 +107,8 @@ Model.setup = function () {
|
||||||
{path: '/:id'}
|
{path: '/:id'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
ModelCtor.sharedCtor.returns = {root: true};
|
||||||
|
|
||||||
return ModelCtor;
|
return ModelCtor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ User.setup = function () {
|
||||||
accepts: [
|
accepts: [
|
||||||
{arg: 'credentials', type: 'object', required: true, http: {source: 'body'}}
|
{arg: 'credentials', type: 'object', required: true, http: {source: 'body'}}
|
||||||
],
|
],
|
||||||
returns: {arg: 'session', type: 'object'},
|
returns: {arg: 'session', type: 'object', root: true},
|
||||||
http: {verb: 'post'}
|
http: {verb: 'post'}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -275,7 +275,7 @@ describe('Model', function() {
|
||||||
{arg: 'username', type: 'string', required: true},
|
{arg: 'username', type: 'string', required: true},
|
||||||
{arg: 'password', type: 'string', required: true}
|
{arg: 'password', type: 'string', required: true}
|
||||||
],
|
],
|
||||||
returns: {arg: 'sessionId', type: 'any'},
|
returns: {arg: 'sessionId', type: 'any', root: true},
|
||||||
http: {path: '/sign-in', verb: 'get'}
|
http: {path: '/sign-in', verb: 'get'}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -292,7 +292,7 @@ describe('Model', function() {
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.end(function(err, res){
|
.end(function(err, res){
|
||||||
if(err) return done(err);
|
if(err) return done(err);
|
||||||
assert(res.body.$data === 123);
|
assert.equal(res.body, 123);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -132,7 +132,7 @@ describe('User', function(){
|
||||||
function logout(err, sid) {
|
function logout(err, sid) {
|
||||||
request(app)
|
request(app)
|
||||||
.post('/users/logout')
|
.post('/users/logout')
|
||||||
.expect(200)
|
.expect(204)
|
||||||
.send({sid: sid})
|
.send({sid: sid})
|
||||||
.end(verify(sid, done));
|
.end(verify(sid, done));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue