From e3d6c6434f570f77c0532f86c82f78bcafb399ec Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Jul 2022 13:44:40 +0200 Subject: Add bulk action on following/followers --- client/src/app/shared/shared-users/user-admin.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/shared-users/user-admin.service.ts') diff --git a/client/src/app/shared/shared-users/user-admin.service.ts b/client/src/app/shared/shared-users/user-admin.service.ts index 3db271c4a..422221d62 100644 --- a/client/src/app/shared/shared-users/user-admin.service.ts +++ b/client/src/app/shared/shared-users/user-admin.service.ts @@ -5,6 +5,7 @@ import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { RestExtractor, RestPagination, RestService, UserService } from '@app/core' import { getBytes } from '@root-helpers/bytes' +import { arrayify } from '@shared/core-utils' import { ResultList, User as UserServerModel, UserCreate, UserRole, UserUpdate } from '@shared/models' @Injectable() @@ -65,7 +66,7 @@ export class UserAdminService { } removeUser (usersArg: UserServerModel | UserServerModel[]) { - const users = Array.isArray(usersArg) ? usersArg : [ usersArg ] + const users = arrayify(usersArg) return from(users) .pipe( @@ -77,7 +78,7 @@ export class UserAdminService { banUsers (usersArg: UserServerModel | UserServerModel[], reason?: string) { const body = reason ? { reason } : {} - const users = Array.isArray(usersArg) ? usersArg : [ usersArg ] + const users = arrayify(usersArg) return from(users) .pipe( @@ -88,7 +89,7 @@ export class UserAdminService { } unbanUsers (usersArg: UserServerModel | UserServerModel[]) { - const users = Array.isArray(usersArg) ? usersArg : [ usersArg ] + const users = arrayify(usersArg) return from(users) .pipe( -- cgit v1.2.3