SES-145 Removed console logs

This commit is contained in:
Łukasz Góreczny 2021-01-12 15:46:38 +01:00
parent d84ecd91a1
commit 11b117d85c
3 changed files with 30 additions and 22 deletions

View File

@ -1,38 +1,48 @@
import { Component, OnInit } from '@angular/core';
import {CharacterStatsViewModel} from "../../../types/viewmodels/character-viewmodels/CharacterStatsViewModel";
import {Store} from "@ngrx/store";
import {AppState} from "../../store/models/app-state.model";
import {CharacterService} from "../../../services/character.service";
import {first} from "rxjs/operators";
import {ErrorResponse} from "../../../types/ErrorResponse";
import {HttpErrorResponse} from "@angular/common/http";
import { CharacterStatsViewModel } from '../../../types/viewmodels/character-viewmodels/CharacterStatsViewModel';
import { Store } from '@ngrx/store';
import { AppState } from '../../store/models/app-state.model';
import { CharacterService } from '../../../services/character.service';
import { first } from 'rxjs/operators';
import { ErrorResponse } from '../../../types/ErrorResponse';
import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-abilities',
templateUrl: './abilities.component.html',
styleUrls: ['./abilities.component.css']
styleUrls: ['./abilities.component.css'],
})
export class AbilitiesComponent implements OnInit {
characterStats: CharacterStatsViewModel[];
constructor(private store: Store<AppState>, private characterService: CharacterService) {}
constructor(
private store: Store<AppState>,
private characterService: CharacterService
) {}
ngOnInit() {
this.getCharacterStats();
}
getCharacterStats() {
this.store.select( s => s.playerStore.characterId).pipe(first()).subscribe((characterId) => {
this.characterService.getCharacterStats(characterId).pipe(first()).subscribe((characterStats) => {
console.log(characterStats)
this.store
.select((s) => s.playerStore.characterId)
.pipe(first())
.subscribe((characterId) => {
this.characterService
.getCharacterStats(characterId)
.pipe(first())
.subscribe(
(characterStats) => {
this.characterStats = characterStats;
}, (error: ErrorResponse | HttpErrorResponse) => {
},
(error: ErrorResponse | HttpErrorResponse) => {
if (error instanceof HttpErrorResponse) {
error = error.error as ErrorResponse;
}
console.error(error.message);
}
);
});
})
}
}

View File

@ -32,7 +32,6 @@ export class GameMasterArmorsTableComponent implements OnInit {
.pipe(first())
.subscribe(
(result) => {
console.log(result);
this.dataSource = new MatTableDataSource(result);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;

View File

@ -32,7 +32,6 @@ export class GameMasterWeaponsTableComponent implements OnInit {
.pipe(first())
.subscribe(
(result) => {
console.log(result);
this.dataSource = new MatTableDataSource(result);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;