-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert UserAPI to Typescript #21
base: minoka-development
Are you sure you want to change the base?
Conversation
…array of Persons. added types to each parameter
…pread out and reassign array.
src/index.ts
Outdated
const targetUser = this.list.find(user => user.id === id) | ||
if (!targetUser) { | ||
throw new Error("There are no users found with that id.") | ||
} | ||
return targetUser | ||
} | ||
|
||
updateUserById(updatedUser) { | ||
updateUserById(updatedUser: Person): Person { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updatedUserById should accept:
a) a user ID for lookup
b) fields to be updated
lookup the TS Utility Partial
, or just create a new object with fields that may be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rachoac should this be refactored to actually update the found Person
object here, rather than accepting a whole, new Person
? @kakizaki55 and I have discussed 1-1 in zoom, so maybe not necessary to practice that pattern here.
…ter to updateuser and updated test accordingly.
…et the first test to pass.
…tUsersById so test are passing.
…o work on error handling of update user by id.
… delete user. .filter for search by name.
User stats methods
Convert to Record Object.
1. What this does:
2. Ticket:
Issue #none
3. Media:
4. How to test:
pull down code run
yarn jest --watch