1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-12-26 13:38:52 +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,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
}

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