mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 16:45:16 +00:00
Can update following status of a frienship
This commit is contained in:
@ -10,6 +10,7 @@ import { UserHelper } from "../helpers/UserHelper";
|
||||
import { GroupsAccessLevel } from "./Group";
|
||||
import { GroupsHelper } from "../helpers/GroupsHelper";
|
||||
import { checkVirtualDirectory } from "../utils/VirtualDirsUtils";
|
||||
import { FriendsHelper } from "../helpers/FriendsHelper";
|
||||
|
||||
/**
|
||||
* Response to a request
|
||||
@ -209,6 +210,20 @@ export class RequestHandler {
|
||||
return userID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ID of a friend included in a POST request
|
||||
*
|
||||
* @param name Name of the POST field
|
||||
*/
|
||||
public async postFriendId(name: string) : Promise<number> {
|
||||
const friendID = await this.postUserId(name);
|
||||
|
||||
if(!await FriendsHelper.AreFriend(this.getUserId(), friendID))
|
||||
this.error(401, "You are not friend with this personn!");
|
||||
|
||||
return friendID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find user ID based on its email address, included in a POST request
|
||||
*
|
||||
|
Reference in New Issue
Block a user