mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-10-31 01:24:43 +00:00 
			
		
		
		
	Delete all user friends
This commit is contained in:
		| @@ -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 | ||||
| 	 *  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user