Moved all auth schemas into their own files. Updated imports.
This commit is contained in:
@ -2,13 +2,13 @@ import { MenuCategory } from './menu-category';
|
||||
import { Printer } from './printer';
|
||||
|
||||
export class SectionPrinter {
|
||||
menuCategory: MenuCategory;
|
||||
printer: Printer;
|
||||
menuCategory: MenuCategory | null;
|
||||
printer: Printer | null;
|
||||
copies: number;
|
||||
|
||||
public constructor(init?: Partial<SectionPrinter>) {
|
||||
this.menuCategory = new MenuCategory();
|
||||
this.printer = new Printer();
|
||||
this.menuCategory = null;
|
||||
this.printer = null;
|
||||
this.copies = 0;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ export class Table {
|
||||
id: string | undefined;
|
||||
name: string;
|
||||
seats: number;
|
||||
section: Section;
|
||||
section?: Section;
|
||||
isActive: boolean;
|
||||
voucherId?: string;
|
||||
status?: string;
|
||||
|
||||
@ -122,7 +122,11 @@ export class SectionPrinterComponent implements OnInit {
|
||||
const array = this.form.get('menuCategories') as FormArray;
|
||||
this.list.forEach((item, index) => {
|
||||
const cont = array.controls[index].value;
|
||||
item.printer = { id: cont.printer };
|
||||
if (cont.printer === null || cont.printer === undefined) {
|
||||
item.printer = null;
|
||||
} else {
|
||||
item.printer = { id: cont.printer };
|
||||
}
|
||||
item.copies = +cont.copies;
|
||||
});
|
||||
return this.list;
|
||||
|
||||
@ -50,7 +50,7 @@ export class TableDetailComponent implements OnInit, AfterViewInit {
|
||||
this.form.setValue({
|
||||
name: this.item.name,
|
||||
seats: this.item.seats,
|
||||
section: this.item.section.id ? this.item.section.id : '',
|
||||
section: this.item.section ? this.item.section.id : '',
|
||||
isActive: this.item.isActive,
|
||||
});
|
||||
}
|
||||
@ -104,6 +104,9 @@ export class TableDetailComponent implements OnInit, AfterViewInit {
|
||||
const formModel = this.form.value;
|
||||
this.item.name = formModel.name;
|
||||
this.item.seats = +formModel.seats;
|
||||
if (this.item.section === null || this.item.section === undefined) {
|
||||
this.item.section = new Section();
|
||||
}
|
||||
this.item.section.id = formModel.section;
|
||||
this.item.isActive = formModel.isActive;
|
||||
return this.item;
|
||||
|
||||
Reference in New Issue
Block a user