import { Component, OnInit, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';

import { MatSnackBar } from '@angular/material/snack-bar'

import { AdminManageDataService } from '../data.service'

@Component({
  selector: 'gisaf-admin-maintenance',
  templateUrl: './maintenance.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminMaintenanceComponent implements OnInit {

  constructor(
    private adminManageDataService: AdminManageDataService,
    private snackBar: MatSnackBar,
    private cdr: ChangeDetectorRef,
  ) { }

  ngOnInit(): void {
  }

  vacuumDb() {
    this.adminManageDataService.vacuumDb().subscribe(
      resp => this.snackBar.open(
        'Database vacuum OK',
        'Close',
      )
    )
  }
}
