This commit is contained in:
Łukasz Góreczny 2021-01-25 11:50:18 +01:00
parent 55a77aec8c
commit 8ff2711363
4 changed files with 9 additions and 12 deletions

View File

@ -47,7 +47,6 @@ export class GameMasterShopkeepersTableComponent implements OnInit {
} }
}, },
(error: ErrorResponse | HttpErrorResponse) => { (error: ErrorResponse | HttpErrorResponse) => {
console.error(error);
if (error instanceof HttpErrorResponse) { if (error instanceof HttpErrorResponse) {
error = error.error as ErrorResponse; error = error.error as ErrorResponse;
} }
@ -68,7 +67,6 @@ export class GameMasterShopkeepersTableComponent implements OnInit {
this.isAnyAvailable = true; this.isAnyAvailable = true;
}, },
(error: ErrorResponse | HttpErrorResponse) => { (error: ErrorResponse | HttpErrorResponse) => {
console.error(error);
if (error instanceof HttpErrorResponse) { if (error instanceof HttpErrorResponse) {
error = error.error as ErrorResponse; error = error.error as ErrorResponse;
} }
@ -89,7 +87,6 @@ export class GameMasterShopkeepersTableComponent implements OnInit {
this.isAnyAvailable = false; this.isAnyAvailable = false;
}, },
(error: ErrorResponse | HttpErrorResponse) => { (error: ErrorResponse | HttpErrorResponse) => {
console.error(error);
if (error instanceof HttpErrorResponse) { if (error instanceof HttpErrorResponse) {
error = error.error as ErrorResponse; error = error.error as ErrorResponse;
} }
@ -114,7 +111,6 @@ export class GameMasterShopkeepersTableComponent implements OnInit {
); );
}, },
(error: ErrorResponse | HttpErrorResponse) => { (error: ErrorResponse | HttpErrorResponse) => {
console.error(error);
if (error instanceof HttpErrorResponse) { if (error instanceof HttpErrorResponse) {
error = error.error as ErrorResponse; error = error.error as ErrorResponse;
} }

View File

@ -104,8 +104,8 @@ export class NewShopkeeperDialogComponent implements OnInit {
return { return {
shopkeeperId: null, shopkeeperId: null,
amount: 1, amount: 1,
armorId: null, armorId: e.id,
weaponId: e.id, weaponId: null,
itemName: e.name, itemName: e.name,
itemType: 'Armor', itemType: 'Armor',
}; };

View File

@ -13,24 +13,24 @@
<ng-container matColumnDef="itemName" > <ng-container matColumnDef="itemName" >
<th mat-header-cell *matHeaderCellDef mat-sort-header > Name </th> <th mat-header-cell *matHeaderCellDef mat-sort-header > Name </th>
<td mat-cell *matCellDef="let row"> <td mat-cell *matCellDef="let row">
<span *ngIf="row.armor != null; else weaponNameBlock" > <span *ngIf="row.armor != null" >
{{row.armor.name}} {{row.armor.name}}
</span> </span>
<ng-template #weaponNameBlock > <span *ngIf="row.weapon != null" >
{{row.weapon.name}} {{row.weapon.name}}
</ng-template> </span>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="itemType"> <ng-container matColumnDef="itemType">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Type </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Type </th>
<td mat-cell *matCellDef="let row"> <td mat-cell *matCellDef="let row">
<span *ngIf="row.armor != null; else weaponTypeBlock" > <span *ngIf="row.armorId !== null" >
Armor Armor
</span> </span>
<ng-template #weaponTypeBlock > <span *ngIf="row.weaponId !== null" >
Weapon Weapon
</ng-template> </span>
</td> </td>
</ng-container> </ng-container>

View File

@ -70,6 +70,7 @@ export class PlayerShopComponent implements OnInit {
} }
BuyItem(weaponId: number, armorId: number) { BuyItem(weaponId: number, armorId: number) {
debugger;
this.store this.store
.select((s) => s.playerStore.characterId) .select((s) => s.playerStore.characterId)
.pipe(first()) .pipe(first())