Chore:
Moved to Angular 16 Moved to FastAPI 0.100.0 Moved to pydantic 2.0
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Modifier } from '../core/modifier';
|
||||
@ -9,7 +8,7 @@ import { ModifierService } from './modifier.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ModifierListResolver implements Resolve<Modifier[]> {
|
||||
export class ModifierListResolver {
|
||||
constructor(private ser: ModifierService) {}
|
||||
|
||||
resolve(): Observable<Modifier[]> {
|
||||
|
||||
@ -10,7 +10,10 @@ export class ModifierListDataSource extends DataSource<Modifier> {
|
||||
public viewData: Modifier[];
|
||||
private filterValue: string;
|
||||
|
||||
constructor(private readonly filter: Observable<string>, private readonly dataObs: Observable<Modifier[]>) {
|
||||
constructor(
|
||||
private readonly filter: Observable<string>,
|
||||
private readonly dataObs: Observable<Modifier[]>,
|
||||
) {
|
||||
super();
|
||||
this.data = [];
|
||||
this.viewData = [];
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<!-- Price Column -->
|
||||
<ng-container matColumnDef="price">
|
||||
<mat-header-cell *matHeaderCellDef>Price</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.price | currency : 'INR' }}</mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.price | currency: 'INR' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Modifier Category Column -->
|
||||
|
||||
@ -29,7 +29,10 @@ export class ModifierListComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = ['name', 'showInBill', 'price', 'isActive', 'modifierCategory'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
) {
|
||||
this.form = new FormGroup({
|
||||
modifierCategory: new FormControl<string | null>(''),
|
||||
});
|
||||
|
||||
@ -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 { Modifier } from '../core/modifier';
|
||||
@ -9,7 +9,7 @@ import { ModifierService } from './modifier.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ModifierResolver implements Resolve<Modifier> {
|
||||
export class ModifierResolver {
|
||||
constructor(private ser: ModifierService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Modifier> {
|
||||
|
||||
@ -15,7 +15,10 @@ const serviceName = 'ModifierService';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ModifierService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
|
||||
get(id: string | null): Observable<Modifier> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user