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 { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
|
||||
import { Product } from '../core/product';
|
||||
@ -8,7 +8,7 @@ import { ProductService } from '../product/product.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProductListResolver implements Resolve<Product[]> {
|
||||
export class ProductListResolver {
|
||||
constructor(private ser: ProductService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Product[]> {
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
<!-- Price Column -->
|
||||
<ng-container matColumnDef="price">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Price</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.price | currency : 'INR' }}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.price | currency: 'INR' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Menu Category Column -->
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { SaleCategory } from '../core/sale-category';
|
||||
@ -9,7 +8,7 @@ import { SaleCategoryService } from './sale-category.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SaleCategoryListResolver implements Resolve<SaleCategory[]> {
|
||||
export class SaleCategoryListResolver {
|
||||
constructor(private ser: SaleCategoryService) {}
|
||||
|
||||
resolve(): Observable<SaleCategory[]> {
|
||||
|
||||
@ -21,13 +21,13 @@
|
||||
<!-- Discount Limit Column -->
|
||||
<ng-container matColumnDef="discountLimit">
|
||||
<mat-header-cell *matHeaderCellDef>Discount Limit</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.discountLimit | percent : '1.2-2' }}</mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.discountLimit | percent: '1.2-2' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Tax Column -->
|
||||
<ng-container matColumnDef="tax">
|
||||
<mat-header-cell *matHeaderCellDef>Tax</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.tax.rate | percent : '1.2-2' }} {{ row.tax.name }}</mat-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.tax.rate | percent: '1.2-2' }} {{ row.tax.name }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
|
||||
@ -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 { SaleCategory } from '../core/sale-category';
|
||||
@ -9,7 +9,7 @@ import { SaleCategoryService } from './sale-category.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SaleCategoryResolver implements Resolve<SaleCategory> {
|
||||
export class SaleCategoryResolver {
|
||||
constructor(private ser: SaleCategoryService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<SaleCategory> {
|
||||
|
||||
@ -16,7 +16,10 @@ const serviceName = 'SaleCategoryService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SaleCategoryService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
|
||||
get(id: string | null): Observable<SaleCategory> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user