Unable to implement PUT request in angular 2 ,getting an error "null values are not allowed"
Asked Answered
C

0

2

I have implemented GET request in my application and able to fetch data for my Account Table in the AccountComponent.

When I click on a particular row in the DataGrid , I get a POPUP window where I can access the row_data and using the dropdowns can update the **DataGrid **

But when I am selecting the required values for the dropdowns and trying to update, I'm getting the following error in my console.

Error code is : Error {"message":"Null values are not allowed","error":"java.lang.NullPointerException","path":"/spacestudy/rockefeller/admin/account/saveAttributes"}

Please access my sample StackBlitz here

Below shown are the screenshots of my sample app.

This is my Account Table

enter image description here

When I click on a row here is my POPUP

enter image description here

When I try to update I'm getting the following error in my console & Network tab

enter image description here enter image description here

But when I'm trying to save it from backend through Swagger UI,then I'm able to successfully update the data

enter image description here

enter image description here

Can anybody please help me to solve this issue....?

Latest screen shot enter image description here

Canary answered 5/9, 2018 at 15:4 Comment(15)
seems like you aren't sending all the data from the form. can you post screenshot of request payload? it's at the bottom of 'headers' tabTelling
okay i will update my question with that screen shotCanary
I have updated my question... please check it out.........!Canary
i meant request payload from network tab. i.sstatic.net/WqUtq.pngTelling
Dude - too much irrelevant images..... and stackblitz does not work as it calls LAN hosts.Exultant
update your stackblz with JSOn data instead of http://192.168.16.89:7072/spacestudy/rockefeller/control/searchfilter/loadDepartments. Because we are not able to access itGraptolite
@Canary update your code also as stackbiltz wont access locally or lan hosted services , also console.log your payload which you are sending in your put request and the java pojo object its getting mapped toItinerate
@Canary place a debugger in updateAccount() func and check if any value is being passed null or undefined in it and as everyone else said update your stackblitz with json data as we can't access your local host.Burdick
thanks to everyone for your feedback .. I will be back with the modifications ...Canary
please access my modified stackblitz here ..stackblitz.com/edit/…Canary
@AbdulRafay... can you please check this updated stackblitz...stackblitz.com/edit/…Canary
@RameshRajendran... can you please check this updated stackblitz..stackblitz.com/edit/…Canary
still I am not able to see the data in gridGraptolite
i have added the json data files for all the get requests..I can see the data in grid in stackblitzCanary
please access this link ...stackblitz.com/edit/…Canary

© 2022 - 2024 — McMap. All rights reserved.