mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-25 06:49:23 +00:00
Delete all the comments of the user
This commit is contained in:
parent
d9248593e9
commit
15c2652b21
@ -442,9 +442,13 @@ export class AccountHelper {
|
|||||||
*/
|
*/
|
||||||
public static async Delete(userID: number) {
|
public static async Delete(userID: number) {
|
||||||
|
|
||||||
// Delete all groups memberships
|
/*// Delete all groups memberships
|
||||||
await GroupsHelper.DeleteAllUsersGroups(userID);
|
await GroupsHelper.DeleteAllUsersGroups(userID);
|
||||||
|
|
||||||
|
// Delete all user comments
|
||||||
|
await CommentsHelper.DeleteAllUser(userID);
|
||||||
|
*/
|
||||||
|
|
||||||
// TODO : continue work
|
// TODO : continue work
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,16 @@ export class CommentsHelper {
|
|||||||
})).map((row) => this.DbToComment(row));
|
})).map((row) => this.DbToComment(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete all the comment of a given user
|
||||||
|
*
|
||||||
|
* @param userID Target user id
|
||||||
|
*/
|
||||||
|
public static async DeleteAllUser(userID: number) {
|
||||||
|
for(const el of await this.ExportAllUser(userID))
|
||||||
|
await this.Delete(el);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn a database entry into a Comment object
|
* Turn a database entry into a Comment object
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user