mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Delete all user responses to surveys
This commit is contained in:
		@@ -450,8 +450,11 @@ export class AccountHelper {
 | 
			
		||||
		
 | 
			
		||||
		// Delete all user posts
 | 
			
		||||
		await PostsHelper.DeleteAllUser(userID);
 | 
			
		||||
		
 | 
			
		||||
		// Delete all responses of user to surveys
 | 
			
		||||
		await SurveyHelper.DeleteAllUserResponses(userID);
 | 
			
		||||
		*/
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
		// TODO : continue work
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -232,6 +232,17 @@ export class SurveyHelper {
 | 
			
		||||
		})).map(this.DBTosurveyResponse)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Delete all user responses to surveys
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID Target user ID
 | 
			
		||||
	 */
 | 
			
		||||
	public static async DeleteAllUserResponses(userID: number) {
 | 
			
		||||
		await DatabaseHelper.DeleteRows(SURVEY_RESPONSE_TABLE, {
 | 
			
		||||
			ID_utilisateurs: userID
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Turn a database entry into a survey object
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user