diff options
author | ilyayudovin <ilyayudovin123.@mail.com> | 2020-06-09 13:14:57 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123.@mail.com> | 2020-06-09 13:14:57 +0300 |
commit | aa01e258948a13abafa7c441a7b82e5c2fb676b9 (patch) | |
tree | b12c66b01786823671118be8f660c9fb1562abf4 /UserService.ts | |
parent | 977992eb70a0ca3b702e116b628d37ac75e667d1 (diff) | |
download | which-api-aa01e258948a13abafa7c441a7b82e5c2fb676b9.tar.gz |
feat: create user service
Diffstat (limited to 'UserService.ts')
-rw-r--r-- | UserService.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/UserService.ts b/UserService.ts new file mode 100644 index 0000000..0cbb649 --- /dev/null +++ b/UserService.ts @@ -0,0 +1,22 @@ +interface User { + info : { + name: string; + age: number; + nationality: string; + sex: string; + } +} + +export class UserService { + users: User[] = []; + + async find (){ + return this.users; + } + + async create(data: Pick<User, 'info'>){ + const user: User = {...data}; + this.users.push(user); + return user; + } +}
\ No newline at end of file |