Skip to content
Snippets Groups Projects
Commit 2117c68d authored by Antonin COQUET's avatar Antonin COQUET Committed by Hugo SUBTIL
Browse files

fix: check for opening hours of structure on component init

parent 8c7787e4
No related branches found
No related tags found
2 merge requests!178release V1.10.0,!154Dev
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);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment