From 3c1b92baa1ac15c23fe63e2f50739105252ca516 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 4 Mar 2017 04:28:38 +0900 Subject: Follow linter --- src/api/endpoints/aggregation/posts/like.ts | 12 ++++-------- src/api/endpoints/aggregation/posts/likes.ts | 6 +----- src/api/endpoints/aggregation/posts/reply.ts | 12 ++++-------- src/api/endpoints/aggregation/posts/repost.ts | 12 ++++-------- src/api/endpoints/aggregation/users/followers.ts | 6 +----- src/api/endpoints/aggregation/users/following.ts | 6 +----- src/api/endpoints/aggregation/users/like.ts | 12 ++++-------- src/api/endpoints/aggregation/users/post.ts | 12 ++++-------- 8 files changed, 23 insertions(+), 55 deletions(-) (limited to 'src/api/endpoints/aggregation') diff --git a/src/api/endpoints/aggregation/posts/like.ts b/src/api/endpoints/aggregation/posts/like.ts index 38ed7e6e16..7eaf0335c7 100644 --- a/src/api/endpoints/aggregation/posts/like.ts +++ b/src/api/endpoints/aggregation/posts/like.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Like from '../../../models/like'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'post_id' parameter const [postId, postIdErr] = it(params.post_id).expect.id().required().qed(); if (postIdErr) return rej('invalid post_id param'); @@ -63,7 +59,7 @@ module.exports = (params) => )[0]; if (data) { - graph.push(data) + graph.push(data); } else { graph.push({ date: { @@ -72,8 +68,8 @@ module.exports = (params) => day: day.getDate() }, count: 0 - }) - }; + }); + } } res(graph); diff --git a/src/api/endpoints/aggregation/posts/likes.ts b/src/api/endpoints/aggregation/posts/likes.ts index 55fe077f64..c39de7d0cb 100644 --- a/src/api/endpoints/aggregation/posts/likes.ts +++ b/src/api/endpoints/aggregation/posts/likes.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Like from '../../../models/like'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'post_id' parameter const [postId, postIdErr] = it(params.post_id).expect.id().required().qed(); if (postIdErr) return rej('invalid post_id param'); diff --git a/src/api/endpoints/aggregation/posts/reply.ts b/src/api/endpoints/aggregation/posts/reply.ts index 1f936bbc2f..541bc594d4 100644 --- a/src/api/endpoints/aggregation/posts/reply.ts +++ b/src/api/endpoints/aggregation/posts/reply.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -12,9 +10,7 @@ import Post from '../../../models/post'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'post_id' parameter const [postId, postIdErr] = it(params.post_id).expect.id().required().qed(); if (postIdErr) return rej('invalid post_id param'); @@ -62,7 +58,7 @@ module.exports = (params) => )[0]; if (data) { - graph.push(data) + graph.push(data); } else { graph.push({ date: { @@ -71,8 +67,8 @@ module.exports = (params) => day: day.getDate() }, count: 0 - }) - }; + }); + } } res(graph); diff --git a/src/api/endpoints/aggregation/posts/repost.ts b/src/api/endpoints/aggregation/posts/repost.ts index e4a1bf7c7b..823a6ed9e3 100644 --- a/src/api/endpoints/aggregation/posts/repost.ts +++ b/src/api/endpoints/aggregation/posts/repost.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -12,9 +10,7 @@ import Post from '../../../models/post'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'post_id' parameter const [postId, postIdErr] = it(params.post_id).expect.id().required().qed(); if (postIdErr) return rej('invalid post_id param'); @@ -62,7 +58,7 @@ module.exports = (params) => )[0]; if (data) { - graph.push(data) + graph.push(data); } else { graph.push({ date: { @@ -71,8 +67,8 @@ module.exports = (params) => day: day.getDate() }, count: 0 - }) - }; + }); + } } res(graph); diff --git a/src/api/endpoints/aggregation/users/followers.ts b/src/api/endpoints/aggregation/users/followers.ts index 9336a102f1..cc217643cf 100644 --- a/src/api/endpoints/aggregation/users/followers.ts +++ b/src/api/endpoints/aggregation/users/followers.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Following from '../../../models/following'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'user_id' parameter const [userId, userIdErr] = it(params.user_id).expect.id().required().qed(); if (userIdErr) return rej('invalid user_id param'); diff --git a/src/api/endpoints/aggregation/users/following.ts b/src/api/endpoints/aggregation/users/following.ts index d468229158..75e0c74694 100644 --- a/src/api/endpoints/aggregation/users/following.ts +++ b/src/api/endpoints/aggregation/users/following.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Following from '../../../models/following'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'user_id' parameter const [userId, userIdErr] = it(params.user_id).expect.id().required().qed(); if (userIdErr) return rej('invalid user_id param'); diff --git a/src/api/endpoints/aggregation/users/like.ts b/src/api/endpoints/aggregation/users/like.ts index 4a932354ad..a1a3b5cd9d 100644 --- a/src/api/endpoints/aggregation/users/like.ts +++ b/src/api/endpoints/aggregation/users/like.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Like from '../../../models/like'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'user_id' parameter const [userId, userIdErr] = it(params.user_id).expect.id().required().qed(); if (userIdErr) return rej('invalid user_id param'); @@ -67,7 +63,7 @@ module.exports = (params) => )[0]; if (data) { - graph.push(data) + graph.push(data); } else { graph.push({ date: { @@ -76,8 +72,8 @@ module.exports = (params) => day: day.getDate() }, count: 0 - }) - }; + }); + } } res(graph); diff --git a/src/api/endpoints/aggregation/users/post.ts b/src/api/endpoints/aggregation/users/post.ts index b62dd6ec98..a4d9e2ddfb 100644 --- a/src/api/endpoints/aggregation/users/post.ts +++ b/src/api/endpoints/aggregation/users/post.ts @@ -1,5 +1,3 @@ -'use strict'; - /** * Module dependencies */ @@ -13,9 +11,7 @@ import Post from '../../../models/post'; * @param {any} params * @return {Promise} */ -module.exports = (params) => - new Promise(async (res, rej) => -{ +module.exports = (params) => new Promise(async (res, rej) => { // Get 'user_id' parameter const [userId, userIdErr] = it(params.user_id).expect.id().required().qed(); if (userIdErr) return rej('invalid user_id param'); @@ -95,7 +91,7 @@ module.exports = (params) => )[0]; if (data) { - graph.push(data) + graph.push(data); } else { graph.push({ date: { @@ -106,8 +102,8 @@ module.exports = (params) => posts: 0, reposts: 0, replies: 0 - }) - }; + }); + } } res(graph); -- cgit v1.2.3-freya