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
This commit is contained in:
@ -12,10 +12,7 @@ describe('RecipeTemplateListResolver', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject(
|
||||
[RecipeTemplateListResolver],
|
||||
(service: RecipeTemplateListResolver) => {
|
||||
expect(service).toBeTruthy();
|
||||
},
|
||||
));
|
||||
it('should be created', inject([RecipeTemplateListResolver], (service: RecipeTemplateListResolver) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
|
||||
@ -8,8 +8,7 @@ import { map } from 'rxjs/operators';
|
||||
import { RecipeTemplate } from '../recipe-template';
|
||||
|
||||
/** Simple sort comparator for example ID/Name columns (for client-side sorting). */
|
||||
const compare = (a: string | number, b: string | number, isAsc: boolean) =>
|
||||
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
export class RecipeTemplateListDataSource extends DataSource<RecipeTemplate> {
|
||||
constructor(
|
||||
public data: RecipeTemplate[],
|
||||
|
||||
@ -14,8 +14,7 @@ const recipeTemplateRoutes: Routes = [
|
||||
path: '',
|
||||
component: RecipeTemplateListComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Recipes',
|
||||
@ -28,8 +27,7 @@ const recipeTemplateRoutes: Routes = [
|
||||
path: 'new',
|
||||
component: RecipeTemplateDetailComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Recipes',
|
||||
@ -42,8 +40,7 @@ const recipeTemplateRoutes: Routes = [
|
||||
path: ':id',
|
||||
component: RecipeTemplateDetailComponent,
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Recipes',
|
||||
|
||||
@ -5,12 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
MAT_DATE_LOCALE,
|
||||
MatNativeDateModule,
|
||||
} from '@angular/material/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
|
||||
@ -23,9 +23,7 @@ export class RecipeTemplateService {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<RecipeTemplate>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||
) as Observable<RecipeTemplate>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<RecipeTemplate>;
|
||||
}
|
||||
|
||||
list(): Observable<RecipeTemplate[]> {
|
||||
|
||||
Reference in New Issue
Block a user