brewman/overlord/src/app/employee-attendance/employee-attendance-routing.module.ts
Amritanshu ac868257b7 Chore: Reformatted everthing
Fix: Product ledger was not totalling.
This is because for some reason, pydantic was sending the data as string when the field was nullable
2023-08-04 21:00:26 +05:30

50 lines
1.7 KiB
TypeScript

import { CommonModule } from '@angular/common';
import { NgModule, inject } from '@angular/core';
import { ActivatedRouteSnapshot, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
import { AttendanceTypeResolver } from '../attendance/attendance-type-resolver.service';
import { AuthGuard } from '../auth/auth-guard.service';
import { EmployeeAttendanceResolver } from './employee-attendance-resolver.service';
import { EmployeeAttendanceComponent } from './employee-attendance.component';
const employeeEmployeeAttendanceRoutes: Routes = [
{
path: '',
component: EmployeeAttendanceComponent,
canActivate: [
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
],
data: {
permission: 'Attendance',
},
resolve: {
info: (route: ActivatedRouteSnapshot) => inject(EmployeeAttendanceResolver).resolve(route),
attendanceTypes: () => inject(AttendanceTypeResolver).resolve(),
},
runGuardsAndResolvers: 'always',
},
{
path: ':id',
component: EmployeeAttendanceComponent,
canActivate: [
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
],
data: {
permission: 'Attendance',
},
resolve: {
info: (route: ActivatedRouteSnapshot) => inject(EmployeeAttendanceResolver).resolve(route),
attendanceTypes: () => inject(AttendanceTypeResolver).resolve(),
},
runGuardsAndResolvers: 'always',
},
];
@NgModule({
imports: [CommonModule, RouterModule.forChild(employeeEmployeeAttendanceRoutes)],
exports: [RouterModule],
providers: [EmployeeAttendanceResolver],
})
export class EmployeeAttendanceRoutingModule {}