Skip to content

Commit 7f6506f

Browse files
committed
Reuse getUserById inside updateUser
Self-review flagged the duplicated find() lookup; updateUser now calls the existing helper instead of re-implementing it.
1 parent 6da3293 commit 7f6506f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

db/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function createUser({ name, email }) {
2525
}
2626

2727
function updateUser(id, { name, email }) {
28-
const user = users.find((user) => user.id === id);
28+
const user = getUserById(id);
2929
if (!user) return undefined;
3030

3131
user.name = name;

0 commit comments

Comments
 (0)