Follow linter
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -16,9 +14,7 @@ import getFriends from '../../common/get-friends';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'user_id' parameter
|
||||
const [userId, userIdErr] = it(params.user_id, 'id', true);
|
||||
if (userIdErr) return rej('invalid user_id param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -16,9 +14,7 @@ import getFriends from '../../common/get-friends';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'user_id' parameter
|
||||
const [userId, userIdErr] = it(params.user_id, 'id', true);
|
||||
if (userIdErr) return rej('invalid user_id param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -15,9 +13,7 @@ import serialize from '../../serializers/post';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'user_id' parameter
|
||||
const [userId, userIdErr] = it(params.user_id, 'id');
|
||||
if (userIdErr) return rej('invalid user_id param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -15,9 +13,7 @@ import getFriends from '../../common/get-friends';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit, limitErr] = it(params.limit).expect.number().range(1, 100).default(10).qed();
|
||||
if (limitErr) return rej('invalid limit param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -17,9 +15,7 @@ const escapeRegexp = require('escape-regexp');
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'query' parameter
|
||||
const [query, queryError] = it(params.query).expect.string().required().trim().validate(x => x != '').qed();
|
||||
if (queryError) return rej('invalid query param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -15,9 +13,7 @@ import serialize from '../../serializers/user';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'query' parameter
|
||||
const [query, queryError] = it(params.query).expect.string().required().trim().validate(validateUsername).qed();
|
||||
if (queryError) return rej('invalid query param');
|
||||
|
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
@@ -14,9 +12,7 @@ import serialize from '../../serializers/user';
|
||||
* @param {any} me
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, me) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'user_id' parameter
|
||||
const [userId, userIdErr] = it(params.user_id, 'id');
|
||||
if (userIdErr) return rej('invalid user_id param');
|
||||
|
Reference in New Issue
Block a user