mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
让 api 接口更合规范
This commit is contained in:
parent
e4f719a915
commit
02b6c72026
@ -37,7 +37,7 @@ var index = function (req, res, next) {
|
||||
'good', 'top', 'author']);
|
||||
});
|
||||
|
||||
res.send(topics);
|
||||
res.send({data: topics});
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -61,7 +61,7 @@ var show = function (req, res, next) {
|
||||
reply = _.pick(reply, ['id', 'author', 'content', 'ups', 'create_at']);
|
||||
return reply;
|
||||
});
|
||||
res.send(topic);
|
||||
res.send({data: topic});
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ var show = function (req, res, next) {
|
||||
return topic;
|
||||
});
|
||||
|
||||
res.send(user);
|
||||
res.send({data: user});
|
||||
});
|
||||
}));
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user