diff options
Diffstat (limited to 'client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts')
-rw-r--r-- | client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts index e2cd2cdc1..0d19565ef 100644 --- a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts +++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { AuthService, ConfirmService, Notifier, ServerService, UserService } from '@app/core' | 2 | import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' |
3 | import { Account, DropdownAction } from '@app/shared/shared-main' | 3 | import { Account, DropdownAction } from '@app/shared/shared-main' |
4 | import { BulkRemoveCommentsOfBody, User, UserRight } from '@shared/models' | 4 | import { BulkRemoveCommentsOfBody, User, UserRight } from '@shared/models' |
5 | import { UserAdminService } from '../shared-users' | ||
5 | import { BlocklistService } from './blocklist.service' | 6 | import { BlocklistService } from './blocklist.service' |
6 | import { BulkService } from './bulk.service' | 7 | import { BulkService } from './bulk.service' |
7 | import { UserBanModalComponent } from './user-ban-modal.component' | 8 | import { UserBanModalComponent } from './user-ban-modal.component' |
@@ -35,7 +36,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
35 | private notifier: Notifier, | 36 | private notifier: Notifier, |
36 | private confirmService: ConfirmService, | 37 | private confirmService: ConfirmService, |
37 | private serverService: ServerService, | 38 | private serverService: ServerService, |
38 | private userService: UserService, | 39 | private userAdminService: UserAdminService, |
39 | private blocklistService: BlocklistService, | 40 | private blocklistService: BlocklistService, |
40 | private bulkService: BulkService | 41 | private bulkService: BulkService |
41 | ) { } | 42 | ) { } |
@@ -66,7 +67,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
66 | const res = await this.confirmService.confirm($localize`Do you really want to unban ${user.username}?`, $localize`Unban`) | 67 | const res = await this.confirmService.confirm($localize`Do you really want to unban ${user.username}?`, $localize`Unban`) |
67 | if (res === false) return | 68 | if (res === false) return |
68 | 69 | ||
69 | this.userService.unbanUsers(user) | 70 | this.userAdminService.unbanUsers(user) |
70 | .subscribe({ | 71 | .subscribe({ |
71 | next: () => { | 72 | next: () => { |
72 | this.notifier.success($localize`User ${user.username} unbanned.`) | 73 | this.notifier.success($localize`User ${user.username} unbanned.`) |
@@ -87,7 +88,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
87 | const res = await this.confirmService.confirm(message, $localize`Delete ${user.username}`) | 88 | const res = await this.confirmService.confirm(message, $localize`Delete ${user.username}`) |
88 | if (res === false) return | 89 | if (res === false) return |
89 | 90 | ||
90 | this.userService.removeUser(user) | 91 | this.userAdminService.removeUser(user) |
91 | .subscribe({ | 92 | .subscribe({ |
92 | next: () => { | 93 | next: () => { |
93 | this.notifier.success($localize`User ${user.username} deleted.`) | 94 | this.notifier.success($localize`User ${user.username} deleted.`) |
@@ -99,7 +100,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
99 | } | 100 | } |
100 | 101 | ||
101 | setEmailAsVerified (user: User) { | 102 | setEmailAsVerified (user: User) { |
102 | this.userService.updateUser(user.id, { emailVerified: true }) | 103 | this.userAdminService.updateUser(user.id, { emailVerified: true }) |
103 | .subscribe({ | 104 | .subscribe({ |
104 | next: () => { | 105 | next: () => { |
105 | this.notifier.success($localize`User ${user.username} email set as verified`) | 106 | this.notifier.success($localize`User ${user.username} email set as verified`) |