Total Complexity | 4 |
Complexity/F | 1.33 |
Lines of Code | 18 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import EventPoll from '../event_poll' |
||
2 | import { ulid } from 'ulid' |
||
3 | |||
4 | class App { |
||
5 | constructor (baseUrl, eventPollRepository) { |
||
6 | this.baseUrl = baseUrl |
||
7 | this.eventPollRepository = eventPollRepository |
||
8 | } |
||
9 | |||
10 | newEventPoll (aTitle, posibleDates) { |
||
11 | const aEventPoll = new EventPoll(ulid(), this.baseUrl, aTitle, posibleDates) |
||
12 | return this.eventPollRepository |
||
13 | .save(aEventPoll) |
||
14 | .then(() => aEventPoll.id) |
||
15 | } |
||
16 | } |
||
17 | |||
18 | export default App |
||
19 |