summaryrefslogtreecommitdiff
path: root/src/api/endpoints/aggregation
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-04 04:28:38 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-04 04:28:38 +0900
commit3c1b92baa1ac15c23fe63e2f50739105252ca516 (patch)
tree35a0ae58802891f05209c83e780440775075e088 /src/api/endpoints/aggregation
parentMerge pull request #233 from syuilo/greenkeeper/inquirer-3.0.6 (diff)
downloadsharkey-3c1b92baa1ac15c23fe63e2f50739105252ca516.tar.gz
sharkey-3c1b92baa1ac15c23fe63e2f50739105252ca516.tar.bz2
sharkey-3c1b92baa1ac15c23fe63e2f50739105252ca516.zip
Follow linter
Diffstat (limited to 'src/api/endpoints/aggregation')
-rw-r--r--src/api/endpoints/aggregation/posts/like.ts12
-rw-r--r--src/api/endpoints/aggregation/posts/likes.ts6
-rw-r--r--src/api/endpoints/aggregation/posts/reply.ts12
-rw-r--r--src/api/endpoints/aggregation/posts/repost.ts12
-rw-r--r--src/api/endpoints/aggregation/users/followers.ts6
-rw-r--r--src/api/endpoints/aggregation/users/following.ts6
-rw-r--r--src/api/endpoints/aggregation/users/like.ts12
-rw-r--r--src/api/endpoints/aggregation/users/post.ts12
8 files changed, 23 insertions, 55 deletions
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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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<any>}
*/
-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);