Chore: Updated resolvers from Class to ResolveFn

This commit is contained in:
2024-05-31 09:45:06 +05:30
parent 6f433ef203
commit 6e3c429db3
255 changed files with 1737 additions and 2155 deletions

View File

@ -0,0 +1,13 @@
import { inject } from '@angular/core';
import { ResolveFn } from '@angular/router';
import { Voucher } from '../core/voucher';
import { VoucherService } from '../core/voucher.service';
export const purchaseResolver: ResolveFn<Voucher> = (route) => {
const id = route.paramMap.get('id');
if (id === null) {
return inject(VoucherService).getOfType('Purchase');
}
return inject(VoucherService).get(id, 'Purchase');
};