Skip to content

Commit

Permalink
chore: fallback to creating a developer if it doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ijemmao committed May 5, 2024
1 parent 4c06d25 commit 8d08544
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controllers/developers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ export const putDeveloper: MiddleWare = async (req, res, next) => {

try {
return res.send(await putDeveloperHelper({ query: { _id: id }, data: req.body }));
} catch (err) {
} catch (err: any) {

Check warning on line 117 in src/controllers/developers/index.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unexpected any. Specify a different type
// 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);
}
return next(err);
}
};
Expand Down

0 comments on commit 8d08544

Please sign in to comment.