Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Updating
- const { accountId } = req.params;
- const account = accounts.find(singleAccount => singleAccount.accountNumber === accountId);
- // Handle cases where account with such an accountNumer is not found
- if (!account) {
- return res.status(400).json({
- status: 'error',
- message: 'No account with the given email',
- });
- }
- // Handle cases where the account is in existence
- const { status } = req.body;
- users.update ({ account }); // Confirm this part
- return res.status(202).json({
- status: 'success',
- account,
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement