1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Delete all user responses to surveys

This commit is contained in:
Pierre HUBERT 2020-03-27 11:48:00 +01:00
parent 30200b9301
commit 003eca2435
2 changed files with 15 additions and 1 deletions

View File

@ -450,6 +450,9 @@ 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

View File

@ -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