Skip to content
Permalink
Browse files

Changed state and type

  • Loading branch information
Evan Langlais
Evan Langlais committed Apr 10, 2019
1 parent c2f31dc commit 73d6f3dd98f6df57db1f4367e1edb69aa8a83d43
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/app/generator-object.ts
  2. +2 −2 src/app/services/generator.service.ts
@@ -11,7 +11,7 @@ export interface GeneratorState {
status: string;
status_code: number;
fault_count: number | null;
fault_codes: Array<number> | null;
fault_codes: Array<string> | null;
ip: string;
}

@@ -19,7 +19,7 @@ export class GeneratorService {
}).subscribe(async (raw_generators: Array<GeneratorObject>) => {
const generators: Array<GeneratorObject> = [];
for (const generator of raw_generators) {
await this.getGeneratorStatus(generator.gen_id, token).then((state: GeneratorState) => {
await this.getGeneratorState(generator.gen_id, token).then((state: GeneratorState) => {
generator.state = state;
generators.push(generator);
}, (error) => {
@@ -33,7 +33,7 @@ export class GeneratorService {
});
}

getGeneratorStatus(gen_id: number, token: string): Promise<GeneratorState> {
getGeneratorState(gen_id: number, token: string): Promise<GeneratorState> {
return new Promise<GeneratorState>((resolve, reject) => {
this.http.get('http://sd5-backend.engr.uconn.edu/generator/' + gen_id + '/status', {
headers: {

0 comments on commit 73d6f3d

Please sign in to comment.
You can’t perform that action at this time.