バグ修正など

This commit is contained in:
syuilo
2018-04-29 17:54:50 +09:00
parent 665afccb45
commit a8083eb52b
6 changed files with 21 additions and 28 deletions

View File

@ -70,12 +70,13 @@ export default async function(
}
});
connection.on('message', data => {
connection.on('message', async data => {
const msg = JSON.parse(data.utf8Data);
switch (msg.type) {
case 'api':
call(msg.endpoint, user, app, msg.data).then(res => {
// 新鮮なデータを利用するためにユーザーをフェッチ
call(msg.endpoint, await User.findOne({ _id: user._id }), app, msg.data).then(res => {
connection.send(JSON.stringify({
type: `api-res:${msg.id}`,
body: { res }