From de9771959850f193f173616b73099c3ae6f010c9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 9 Jun 2020 19:23:44 +0300 Subject: feat!: integrate mongoDB --- services/polls/polls.class.ts | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 services/polls/polls.class.ts (limited to 'services/polls/polls.class.ts') 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) { - const poll: Poll = { ...data, author: defaultUser }; - this.polls.push(poll); - return poll; - } -} - -- cgit v1.2.3