title: Angular Service not passing values to backend - Header Error issue
body: <p>I can't figure out why my values aren't being passed from the angular service to the express/mongoose PATCH call. It makes it to the document in the table, but updates currentBid to null and lastBidTimeStamp and bidderId don't update.</p>
  
  <p>If I use postman like this: </p>
  
  <p><a href="https://postimg.cc/1nQnX3zK" rel="nofollow noreferrer">https://postimg.cc/1nQnX3zK</a>  </p>
  
  <p>The two values don't update that way either. Only currentBid updates in postman. </p>
  
  <p>I did console.log(lastBidTimeStamp) in service and it outputted date correctly so it's receiving the value in the service.</p>
  
  <p>Not sure what I'm doing wrong. Still learning. Any help is appreciated.</p>
  
  <p>bidding.service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient, HttpParams } from '@angular/common/http';
  import { Router } from '@angular/router';
  import { Subject } from 'rxjs';
  import { Bidding } from './bidding.model';
  
  
  @Injectable({ providedIn: 'root' })
  export class BiddingService {
  
  
    constructor(private http: HttpClient, private router: Router) { }
  
  
    submitBid(auctionId: string, currentBid: string, lastBidTimeStamp: Date, userId: string) {
  
  
  
      const bidding: Bidding = {
        id: auctionId,
        bidderId: userId,
        lastBidTimeStamp: lastBidTimeStamp,
        bidValue: currentBid
      };
  
      return this.http.patch(`http://localhost:3000/api/listings/${bidding.id}`, bidding,
      );
  
    }
  
  }
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>app.use((req, res, next) =&gt; {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
  res.header("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS");
  next();
  });
  
  
  
  
  
  
     app.patch('/api/listings/:id', (req, res) =&gt;
  Post.update(
    {id: req.query.id},
    {currentBid: req.body.currentBid},
    {lastBidTimeStamp: req.body.lastBidTimeStamp},
   // {bidderId: req.userData.userId}
    ).then( user =&gt; {
    console.log(user);
    res.json(user);
    // res.sendStatus(200);
    })
  
  
  .then( user =&gt; {
  console.log(res.json(user));
  res.json(user);
  // res.sendStatus(200);
  }).catch(err =&gt; console.log(err)));
  </code></pre>