mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Can delete all the likes of a given user
This commit is contained in:
		@@ -453,6 +453,9 @@ export class AccountHelper {
 | 
				
			|||||||
		
 | 
							
 | 
				
			||||||
		// Delete all responses of user to surveys
 | 
							// Delete all responses of user to surveys
 | 
				
			||||||
		await SurveyHelper.DeleteAllUserResponses(userID);
 | 
							await SurveyHelper.DeleteAllUserResponses(userID);
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// Delete all the likes created by the user
 | 
				
			||||||
 | 
							await LikesHelper.DeleteAllUser(userID);
 | 
				
			||||||
		*/
 | 
							*/
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// TODO : continue work
 | 
							// TODO : continue work
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -135,6 +135,17 @@ export class LikesHelper {
 | 
				
			|||||||
		})).map(this.DBToUserLike);
 | 
							})).map(this.DBToUserLike);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Delete all the likes of a given user
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 * @param userID Target user ID
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public static async DeleteAllUser(userID: number) {
 | 
				
			||||||
 | 
							await DatabaseHelper.DeleteRows(LIKES_TABLE, {
 | 
				
			||||||
 | 
								ID_personne: userID
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Turn a database entry into a like entry
 | 
						 * Turn a database entry into a like entry
 | 
				
			||||||
	 * 
 | 
						 * 
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user