mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-10-31 01:24:43 +00:00 
			
		
		
		
	Delete all user responses to surveys
This commit is contained in:
		| @@ -450,8 +450,11 @@ export class AccountHelper { | |||||||
| 		 | 		 | ||||||
| 		// Delete all user posts | 		// Delete all user posts | ||||||
| 		await PostsHelper.DeleteAllUser(userID); | 		await PostsHelper.DeleteAllUser(userID); | ||||||
|  | 		 | ||||||
|  | 		// Delete all responses of user to surveys | ||||||
|  | 		await SurveyHelper.DeleteAllUserResponses(userID); | ||||||
| 		*/ | 		*/ | ||||||
|  | 		 | ||||||
| 		// TODO : continue work | 		// TODO : continue work | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -232,6 +232,17 @@ export class SurveyHelper { | |||||||
| 		})).map(this.DBTosurveyResponse) | 		})).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 | 	 * Turn a database entry into a survey object | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user