aboutsummaryrefslogtreecommitdiff
path: root/UserService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'UserService.ts')
-rw-r--r--UserService.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/UserService.ts b/UserService.ts
index 0cbb649..57a883c 100644
--- a/UserService.ts
+++ b/UserService.ts
@@ -1,10 +1,7 @@
interface User {
- info : {
- name: string;
- age: number;
- nationality: string;
- sex: string;
- }
+ name: string;
+ avatarUrl?: string;
+ age?: number;
}
export class UserService {
@@ -14,9 +11,10 @@ export class UserService {
return this.users;
}
- async create(data: Pick<User, 'info'>){
- const user: User = {...data};
+ async create(data: Pick<User, 'name' | 'avatarUrl' | 'age'>){
+ const user: User = { ...data };
this.users.push(user);
return user;
}
-} \ No newline at end of file
+}
+