Chore:
Moved to Angular 16 Moved to FastAPI 0.100.0 Moved to pydantic 2.0
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, Router } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Role } from './role';
|
||||
@ -8,8 +8,11 @@ import { RoleService } from './role.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleListResolver implements Resolve<Role[]> {
|
||||
constructor(private ser: RoleService, private router: Router) {}
|
||||
export class RoleListResolver {
|
||||
constructor(
|
||||
private ser: RoleService,
|
||||
private router: Router,
|
||||
) {}
|
||||
|
||||
resolve(): Observable<Role[]> {
|
||||
return this.ser.list();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Role } from './role';
|
||||
@ -8,7 +8,7 @@ import { RoleService } from './role.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleResolver implements Resolve<Role> {
|
||||
export class RoleResolver {
|
||||
constructor(private ser: RoleService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Role> {
|
||||
|
||||
@ -17,7 +17,10 @@ const serviceName = 'RoleService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
|
||||
get(id: string | null): Observable<Role> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user