mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 07:15:07 +01:00
Refactor frontend data models
This commit is contained in:
parent
5723bd8dd8
commit
66b2d90c50
120 changed files with 640 additions and 706 deletions
|
|
@ -1,14 +1,14 @@
|
|||
import { HttpClient } from '@angular/common/http'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { Observable, switchMap } from 'rxjs'
|
||||
import { PaperlessUser } from 'src/app/data/paperless-user'
|
||||
import { User } from 'src/app/data/user'
|
||||
import { PermissionsService } from '../permissions.service'
|
||||
import { AbstractNameFilterService } from './abstract-name-filter-service'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UserService extends AbstractNameFilterService<PaperlessUser> {
|
||||
export class UserService extends AbstractNameFilterService<User> {
|
||||
constructor(
|
||||
http: HttpClient,
|
||||
private permissionService: PermissionsService
|
||||
|
|
@ -16,7 +16,7 @@ export class UserService extends AbstractNameFilterService<PaperlessUser> {
|
|||
super(http, 'users')
|
||||
}
|
||||
|
||||
update(o: PaperlessUser): Observable<PaperlessUser> {
|
||||
update(o: User): Observable<User> {
|
||||
return this.getCached(o.id).pipe(
|
||||
switchMap((initialUser) => {
|
||||
initialUser.user_permissions?.forEach((perm) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue