This commit is contained in:
syuilo
2018-07-06 02:58:29 +09:00
parent fcfd9239c1
commit 9b41023c43
109 changed files with 212 additions and 130 deletions

View File

@@ -6,7 +6,7 @@ import create from '../../../../services/following/create';
/**
* Follow a user
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter

View File

@@ -6,7 +6,7 @@ import deleteFollowing from '../../../../services/following/delete';
/**
* Unfollow a user
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter

View File

@@ -5,7 +5,7 @@ import User, { ILocalUser } from '../../../../../models/user';
/**
* Accept a follow request
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [followerId, followerIdErr] = $.type(ID).get(params.userId);
if (followerIdErr) return rej('invalid userId param');

View File

@@ -5,7 +5,7 @@ import User, { pack, ILocalUser } from '../../../../../models/user';
/**
* Cancel a follow request
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [followeeId, followeeIdErr] = $.type(ID).get(params.userId);
if (followeeIdErr) return rej('invalid userId param');

View File

@@ -5,7 +5,7 @@ import { ILocalUser } from '../../../../../models/user';
/**
* Get all pending received follow requests
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const reqs = await FollowRequest.find({
followeeId: user._id
});

View File

@@ -5,7 +5,7 @@ import User, { ILocalUser } from '../../../../../models/user';
/**
* Reject a follow request
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
// Get 'userId' parameter
const [followerId, followerIdErr] = $.type(ID).get(params.userId);
if (followerIdErr) return rej('invalid userId param');

View File

@@ -5,7 +5,7 @@ import { ILocalUser } from '../../../../models/user';
/**
* Stalk a user
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter

View File

@@ -5,7 +5,7 @@ import { ILocalUser } from '../../../../models/user';
/**
* Unstalk a user
*/
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const follower = user;
// Get 'userId' parameter