mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-26 13:38:52 +00:00
Delete all user friends
This commit is contained in:
parent
aa9ae35ea3
commit
30740b8016
@ -469,6 +469,9 @@ export class AccountHelper {
|
||||
|
||||
// Delete all the notifications related with the user
|
||||
await NotificationsHelper.DeleteAllRelatedWithUser(userID);
|
||||
|
||||
// Delete all user friends, including friendship requests
|
||||
await FriendsHelper.DeleteAllUser(userID);
|
||||
*/
|
||||
|
||||
// TODO : continue work
|
||||
|
@ -329,6 +329,21 @@ export class FriendsHelper {
|
||||
return result["autoriser_post_page"] == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the friends of a given user
|
||||
*
|
||||
* @param userID Target user ID
|
||||
*/
|
||||
public static async DeleteAllUser(userID: number) {
|
||||
await DatabaseHelper.DeleteRows(FRIENDS_TABLE, {
|
||||
ID_personne: userID
|
||||
})
|
||||
|
||||
await DatabaseHelper.DeleteRows(FRIENDS_TABLE, {
|
||||
ID_amis: userID
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a database entry into a {Friend} object
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user