Skip to content

Commit

Permalink
Poll service implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Jun 27, 2019
1 parent 81d40ad commit aeac6f1
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/app/poll.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Session } from './session';
import { MemberVote } from './card';
import { Observable } from 'rxjs';

export class PollResponse {
name: string;
timestamp: number;

topic: string;
description: string;
url: string;

flipped: boolean;
consensus: boolean;

votes: MemberVote[];
}

@Injectable({
providedIn: 'root'
})
export class PollService {

constructor() { }
constructor(private http: HttpClient) { }

currentPoll(session: Session) : Observable<PollResponse> {
return this.http.get<PollResponse>('/api/poll/current/' + session.id);
}
}

0 comments on commit aeac6f1

Please sign in to comment.