Skip to content

Commit

Permalink
fix: use name instead of displayName when updating developer
Browse files Browse the repository at this point in the history
  • Loading branch information
ijemmao committed May 5, 2024
1 parent 8d08544 commit 30de4dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/controllers/developers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,7 @@ export const putDeveloper: MiddleWare = async (req, res, next) => {

try {
return res.send(await putDeveloperHelper({ query: { _id: id }, data: req.body }));
} catch (err: any) {
// TODO: write test to make sure that when there's no developer, the postDeveloper method
// gets called
if (err.message === 'No developer to update') {
return postDeveloper(req, res, next);
}
} catch (err) {
return next(err);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/APIs/DevelopersAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const putDeveloper = async (user: Partial<User>) => {
data: {
firebaseId: user.uid,
email: user.email,
displayName: user.displayName,
name: user.displayName,
},
});

Expand Down

0 comments on commit 30de4dc

Please sign in to comment.