summaryrefslogtreecommitdiff
path: root/src/api/serializers
diff options
context:
space:
mode:
authorotofune <otofune@gmail.com>2017-11-05 22:26:16 +0900
committerotofune <otofune@gmail.com>2017-11-05 22:26:16 +0900
commit7cd6b1c666605c7a256e4a8dd8db5edeb02da6db (patch)
treebcaf1d3c35866b282b547371646f772db90cf5b2 /src/api/serializers
parentserializers - user: run promises in parallel as possible (diff)
downloadsharkey-7cd6b1c666605c7a256e4a8dd8db5edeb02da6db.tar.gz
sharkey-7cd6b1c666605c7a256e4a8dd8db5edeb02da6db.tar.bz2
sharkey-7cd6b1c666605c7a256e4a8dd8db5edeb02da6db.zip
follow lint
Diffstat (limited to 'src/api/serializers')
-rw-r--r--src/api/serializers/post.ts12
-rw-r--r--src/api/serializers/user.ts6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/api/serializers/post.ts b/src/api/serializers/post.ts
index 99e9bb667c..e1ab784359 100644
--- a/src/api/serializers/post.ts
+++ b/src/api/serializers/post.ts
@@ -108,7 +108,7 @@ const self = (
}
});
return prev ? prev._id : null;
- })()
+ })();
// Get next post info
_post.next = (async () => {
@@ -126,7 +126,7 @@ const self = (
}
});
return next ? next._id : null;
- })()
+ })();
if (_post.reply_id) {
// Populate reply to post
@@ -158,8 +158,8 @@ const self = (
myChoice.is_voted = true;
}
- return poll
- })(_post.poll)
+ return poll;
+ })(_post.poll);
}
// Fetch my reaction
@@ -176,13 +176,13 @@ const self = (
return reaction.reaction;
}
- return null
+ return null;
})();
}
}
// resolve promises in _post object
- _post = await rap(_post)
+ _post = await rap(_post);
resolve(_post);
});
diff --git a/src/api/serializers/user.ts b/src/api/serializers/user.ts
index 3527921ded..d00f073897 100644
--- a/src/api/serializers/user.ts
+++ b/src/api/serializers/user.ts
@@ -112,7 +112,7 @@ export default (
deleted_at: { $exists: false }
});
return follow !== null;
- })()
+ })();
// If the user is followed
_user.is_followed = (async () => {
@@ -122,7 +122,7 @@ export default (
deleted_at: { $exists: false }
});
return follow2 !== null;
- })()
+ })();
}
if (opts.detail) {
@@ -153,7 +153,7 @@ export default (
}
// resolve promises in _user object
- _user = await rap(_user)
+ _user = await rap(_user);
resolve(_user);
});