mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Delete all the comments of the user
This commit is contained in:
		@@ -442,9 +442,13 @@ export class AccountHelper {
 | 
			
		||||
	 */
 | 
			
		||||
	public static async Delete(userID: number) {
 | 
			
		||||
 | 
			
		||||
		// Delete all groups memberships
 | 
			
		||||
		/*// Delete all groups memberships
 | 
			
		||||
		await GroupsHelper.DeleteAllUsersGroups(userID);
 | 
			
		||||
		
 | 
			
		||||
		// Delete all user comments
 | 
			
		||||
		await CommentsHelper.DeleteAllUser(userID);
 | 
			
		||||
		*/
 | 
			
		||||
		
 | 
			
		||||
		// TODO : continue work
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -172,6 +172,16 @@ export class CommentsHelper {
 | 
			
		||||
		})).map((row) => this.DbToComment(row));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Delete all the comment of a given user
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID Target user id
 | 
			
		||||
	 */
 | 
			
		||||
	public static async DeleteAllUser(userID: number) {
 | 
			
		||||
		for(const el of await this.ExportAllUser(userID))
 | 
			
		||||
			await this.Delete(el);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Turn a database entry into a Comment object
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user