wip
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
	});
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user