SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //  Updating
  2.  
  3.  
  4. const { accountId } = req.params;
  5. const account = accounts.find(singleAccount => singleAccount.accountNumber === accountId);
  6.  
  7. //  Handle cases where account with such an accountNumer is not found
  8.   if (!account) {
  9.     return res.status(400).json({
  10.       status: 'error',
  11.       message: 'No account with the given email',
  12.     });
  13.   }
  14.  
  15. //  Handle cases where the account is in existence
  16. const { status } = req.body;
  17.  
  18.   users.update ({ account });  // Confirm this part
  19.  
  20.   return res.status(202).json({
  21.     status: 'success',
  22.     account,
  23.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top