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

Can delete all the likes of a given user

This commit is contained in:
Pierre HUBERT 2020-03-27 11:52:28 +01:00
parent 003eca2435
commit df2d2b66be
2 changed files with 14 additions and 0 deletions

View File

@ -453,6 +453,9 @@ export class AccountHelper {
// Delete all responses of user to surveys
await SurveyHelper.DeleteAllUserResponses(userID);
// Delete all the likes created by the user
await LikesHelper.DeleteAllUser(userID);
*/
// TODO : continue work

View File

@ -135,6 +135,17 @@ export class LikesHelper {
})).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
*