| Conditions | 5 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import {PollState, taskEvent} from '../helpers/interfaces'; |
||
| 29 | |||
| 30 | async getStateFromMessageId(): Promise<PollState> { |
||
| 31 | const request = { |
||
| 32 | name: this.event.id, |
||
| 33 | }; |
||
| 34 | const apiResponse = await callMessageApi('get', request); |
||
| 35 | const currentState = getStateFromCardName(apiResponse.data!.cardsV2?.[0].card ?? {}); |
||
| 36 | if (!currentState) { |
||
| 37 | throw new Error('State not found'); |
||
| 38 | } |
||
| 39 | return JSON.parse(currentState) as PollState; |
||
| 40 | } |
||
| 52 |