All files / src/app/components/custom-views custom-views.component.ts

75% Statements 6/8
100% Branches 2/2
71.42% Functions 5/7
71.42% Lines 5/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                            94x       3x     3x   3x   3x                          
import { Component, OnInit } from '@angular/core';
import { CustomView } from '../../models/customView';
import { TableModule } from 'primeng/table';
import { TagModule } from 'primeng/tag';
import { RouterModule } from '@angular/router';
import { TwinpadApiService } from '../../services/twinpad-api.service';
 
 
@Component({
  selector: 'app-custom-views',
  imports: [TableModule, TagModule, RouterModule],
  templateUrl: './custom-views.component.html',
  styleUrl: './custom-views.component.scss'
})
export class CustomViewsComponent implements OnInit {
 
  customViews: CustomView[];
 
  constructor(private twinpadApiService: TwinpadApiService){}
 
  ngOnInit(): void {
    this.twinpadApiService.getProfile().subscribe({
      next: value => {
        this.twinpadApiService.getCustomViewsFromUserId(value.id).subscribe({
          next: value => {
            this.customViews = value;
          },
          error: error => {
            console.log(error.error);
          }
        });
      },
      error: error => {
        console.log(error.error);
      }
    });
  }
}