Skip to content

Commit 6593fe3

Browse files
committed
fixed compile error introduced by correcting the return type of the post method
1 parent 63f65aa commit 6593fe3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

client/src/app/dashboard/dashboard-card/dashboard-card.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {EventType, EventTypeEnum} from '../../api/model/socketMessage';
2121
import {ComponentType, ComponentTypeEnum} from '../../api/model/instance';
2222
import {ApiService} from '../../api/api/api.service';
2323
import {SocketService} from '../../api/api/socket.service';
24+
import { HttpEvent } from '@angular/common/http';
2425

2526

2627

@@ -83,7 +84,7 @@ export class DashboardCardComponent implements OnInit {
8384
* If there is no server connection the value is set to a default error message.
8485
*/
8586
private setInstanceNumber() {
86-
this.irService.getNumberOfInstances(this.componentType).subscribe((amount: number) => {
87+
this.irService.getNumberOfInstances(this.componentType).subscribe((amount: HttpEvent<number>) => {
8788
this.numberOfInstances = '' + amount;
8889
}, () => {
8990
this.numberOfInstances = 'No server connection';

client/src/app/dashboard/table-all/table-all.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatTable, MatPaginator, MatTa
2222
import { DeleteDialogComponent } from '../delete-dialog/delete-dialog.component';
2323
import { AddDialogComponent } from '../add-dialog/add-dialog.component';
2424
import { ApiService } from '../../api/api/api.service';
25+
import { HttpEvent } from '@angular/common/http';
2526

2627

2728

@@ -77,7 +78,7 @@ export class TableAllComponent implements OnInit {
7778
console.log('data', this.dataSource.data);
7879

7980
} else {
80-
this.apiService.deleteInstance(id).subscribe((deleteResult: number) => {
81+
this.apiService.deleteInstance(id).subscribe((deleteResult: HttpEvent<number>) => {
8182
console.log('result', deleteResult);
8283
}, err => {
8384
console.log('error delete Instance');
@@ -133,7 +134,7 @@ export class TableAllComponent implements OnInit {
133134
*/
134135
public startInstance(id: string): void {
135136

136-
this.apiService.startInstance(id).subscribe((result: number) => {
137+
this.apiService.startInstance(id).subscribe((result: HttpEvent<number>) => {
137138
console.log('result', result);
138139
}, err => {
139140
console.log('error start Instance', err);
@@ -146,7 +147,7 @@ export class TableAllComponent implements OnInit {
146147
*/
147148
public stopInstance(id: string): void {
148149

149-
this.apiService.stopInstance(id).subscribe((result: number) => {
150+
this.apiService.stopInstance(id).subscribe((result: HttpEvent<number>) => {
150151
console.log('result', result);
151152
}, err => {
152153
console.log('error stop Instance', err);
@@ -159,7 +160,7 @@ export class TableAllComponent implements OnInit {
159160
*/
160161
public pauseInstance(id: string): void {
161162

162-
this.apiService.pauseInstance(id).subscribe((result: number) => {
163+
this.apiService.pauseInstance(id).subscribe((result: HttpEvent<number>) => {
163164
console.log('result', result);
164165
}, err => {
165166
console.log('error pause instance', err);
@@ -172,7 +173,7 @@ export class TableAllComponent implements OnInit {
172173
*/
173174
public resumeInstance(id: string): void {
174175

175-
this.apiService.resumeInstance(id).subscribe((result: number) => {
176+
this.apiService.resumeInstance(id).subscribe((result: HttpEvent<number>) => {
176177
console.log('result', result);
177178
}, err => {
178179
console.log('error pause instance', err);

0 commit comments

Comments
 (0)