aboutsummaryrefslogtreecommitdiff
path: root/PollService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'PollService.ts')
-rw-r--r--PollService.ts38
1 files changed, 0 insertions, 38 deletions
diff --git a/PollService.ts b/PollService.ts
deleted file mode 100644
index 2944af3..0000000
--- a/PollService.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-interface ImageData {
- url: string;
- votes: number;
-}
-
-interface User {
- name: string;
- avatarUrl: string;
-}
-
-export interface Poll {
- author: User;
- contents: {
- left: ImageData;
- right: ImageData;
- };
-}
-
-const defaultUser: User = {
- name: 'John Doe',
- avatarUrl: 'https://github.com/eug-vs.png'
-};
-
-
-export class PollService {
- polls: Poll[] = [];
-
- async find () {
- return this.polls;
- }
-
- async create (data: Pick<Poll, 'contents'>) {
- const poll: Poll = { ...data, author: defaultUser };
- this.polls.push(poll);
- return poll;
- }
-}
-