Feautre: Recipe export to xlsx Chore: Python 11 style type annotations Chore: Moved to sqlalchemy 2.0 Chore: Minimum python is 3.11 Fix: Fix nullability of a lot of fields in the database.
22 lines
604 B
TypeScript
22 lines
604 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ActivatedRouteSnapshot } from '@angular/router';
|
|
import { Observable } from 'rxjs/internal/Observable';
|
|
|
|
import { Voucher } from '../core/voucher';
|
|
import { VoucherService } from '../core/voucher.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class PurchaseResolver {
|
|
constructor(private ser: VoucherService) {}
|
|
|
|
resolve(route: ActivatedRouteSnapshot): Observable<Voucher> {
|
|
const id = route.paramMap.get('id');
|
|
if (id === null) {
|
|
return this.ser.getOfType('Purchase');
|
|
}
|
|
return this.ser.get(id, 'Purchase');
|
|
}
|
|
}
|