Skip to content
Snippets Groups Projects

fix: check for opening hours of structure on component init

Merged Antonin COQUET requested to merge fix/opening-structure-creation into dev
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
import { Component, Input, OnInit } from '@angular/core';
import { Structure } from '../../../models/structure.model';
import { StructureService } from '../../../services/structure.service';
@Component({
selector: 'app-structure-opening-status',
@@ -10,7 +11,11 @@ export class StructureOpeningStatusComponent implements OnInit {
@Input() public structure: Structure;
@Input() public isCalledByDetails: boolean;
constructor() {}
constructor(private structureService: StructureService) {}
ngOnInit(): void {}
ngOnInit(): void {
if (!this.structure.isOpen && !this.structure.openedOn.day) {
this.structure = this.structureService.updateOpeningStructure(this.structure);
}
}
}
Loading