-1

JSON Data:

{
  "role": [ "Jungle", "Mid" ],
  "total_wins": 0
}

This is the request I'm using, using npm request.

   request({
          uri: uri, 
          method: "PATCH", 
          json: {
            "total_wins": 1, 
            "role": ["Support", "Top"]
          }
   });

output:

{
  "role": [ "Jungle", "Mid" ],
  "total_wins": 1
}

expected:

{
  "role": [ "Support", "Top" ],
  "total_wins": 1
}

I'm not sure whats happening, the PATCH request produces no errors, but it doesn't change any data for role, yet it changes the total_wins to 1.

Eric Chu
  • 1,649
  • 3
  • 20
  • 26

1 Answers1

0

check your controller and params, did it permit role?

buncis
  • 2,148
  • 1
  • 23
  • 25