Moved to Angular 16
Moved to FastAPI 0.100.0
Moved to pydantic 2.0
This commit is contained in:
2023-07-22 09:19:48 +05:30
parent 8b2d15b9e1
commit 09b762d154
161 changed files with 693 additions and 753 deletions

View File

@ -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();

View File

@ -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> {

View File

@ -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}`;