mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	refactor: simplify remote (un)follow controller
This commit is contained in:
		| @@ -16,7 +16,7 @@ const user = require('../user'); | ||||
|  | ||||
| const activitypubApi = module.exports; | ||||
|  | ||||
| activitypubApi.follow = async (caller, { actorId } = {}) => { | ||||
| activitypubApi.follow = async (caller, { uid: actorId } = {}) => { | ||||
| 	const object = await activitypub.getActor(caller.uid, actorId); | ||||
| 	if (!object) { | ||||
| 		throw new Error('[[error:activitypub.invalid-id]]'); | ||||
| @@ -28,7 +28,7 @@ activitypubApi.follow = async (caller, { actorId } = {}) => { | ||||
| 	}); | ||||
| }; | ||||
|  | ||||
| activitypubApi.unfollow = async (caller, { actorId }) => { | ||||
| activitypubApi.unfollow = async (caller, { uid: actorId }) => { | ||||
| 	const object = await activitypub.getActor(caller.uid, actorId); | ||||
| 	const userslug = await user.getUserField(caller.uid, 'userslug'); | ||||
| 	if (!object) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user