Last active
January 20, 2019 20:17
-
-
Save shlomokraus/94f897d5e6cfcb44d006b95b03f721ac to your computer and use it in GitHub Desktop.
Example of UserService
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IUser { | |
id: string; | |
name: string; | |
email: string; | |
} | |
export class UserService { | |
constructor(private readonly db){} | |
async getUser(id: string):Promise<IUser>{ | |
const user = await this.db.findOneById(id); | |
return { | |
id: user.id, | |
name: user.name, | |
email: user.email | |
}; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment