diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-09 14:16:15 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-09 14:16:15 +0300 |
commit | e9d0438f6c02664c652a593c686564361fa0de6b (patch) | |
tree | 5bc0a1e78cf72c6e1ae48f5ee3954511748c81b1 /services/users/users.class.ts | |
parent | 24f0d8709fc5e90a92d9c3940e693f76cd653bf4 (diff) | |
download | which-api-e9d0438f6c02664c652a593c686564361fa0de6b.tar.gz |
refactor: structurize feathers app
Diffstat (limited to 'services/users/users.class.ts')
-rw-r--r-- | services/users/users.class.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/services/users/users.class.ts b/services/users/users.class.ts new file mode 100644 index 0000000..db6b5a9 --- /dev/null +++ b/services/users/users.class.ts @@ -0,0 +1,20 @@ +interface User { + name: string; + avatarUrl?: string; + age?: number; +} + +export default class Users { + users: User[] = []; + + async find (){ + return this.users; + } + + async create(data: Pick<User, 'name' | 'avatarUrl' | 'age'>){ + const user: User = { ...data }; + this.users.push(user); + return user; + } +} + |