generated from nhcarrigan/template
feat: security and auditing
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @copyright 2026 NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ApiService } from './api.service';
|
||||
import { User } from '@library/shared-types';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserService {
|
||||
private api = inject(ApiService);
|
||||
|
||||
getAllUsers(): Observable<User[]> {
|
||||
return this.api.get<User[]>('/users');
|
||||
}
|
||||
|
||||
banUser(userId: string): Observable<User> {
|
||||
return this.api.post<User>(`/users/${userId}/ban`, {});
|
||||
}
|
||||
|
||||
unbanUser(userId: string): Observable<User> {
|
||||
return this.api.post<User>(`/users/${userId}/unban`, {});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user