diff --git a/src/app/poll.service.ts b/src/app/poll.service.ts index 9c1f031..153d83b 100644 --- a/src/app/poll.service.ts +++ b/src/app/poll.service.ts @@ -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 { + return this.http.get('/api/poll/current/' + session.id); + } }