aboutsummaryrefslogtreecommitdiff
path: root/services/polls/polls.class.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-09 19:23:44 +0300
committereug-vs <eug-vs@keemail.me>2020-06-09 19:23:44 +0300
commitde9771959850f193f173616b73099c3ae6f010c9 (patch)
tree65262d9badbc46f99d8644705c4aeed62e5373ca /services/polls/polls.class.ts
parent39d637a817460ee62a0a6667abd6afc5b6898895 (diff)
downloadwhich-api-de9771959850f193f173616b73099c3ae6f010c9.tar.gz
feat!: integrate mongoDB
Diffstat (limited to 'services/polls/polls.class.ts')
-rw-r--r--services/polls/polls.class.ts38
1 files changed, 0 insertions, 38 deletions
diff --git a/services/polls/polls.class.ts b/services/polls/polls.class.ts
deleted file mode 100644
index 82ef155..0000000
--- a/services/polls/polls.class.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-interface ImageData {
- url: string;
- votes: number;
-}
-
-interface User {
- name: string;
- avatarUrl: string;
-}
-
-interface Poll {
- author: User;
- contents: {
- left: ImageData;
- right: ImageData;
- };
-}
-
-const defaultUser: User = {
- name: 'John Doe',
- avatarUrl: 'https://github.com/eug-vs.png'
-};
-
-
-export default class Polls {
- 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;
- }
-}
-