Skip to content
Advertisement

Retrieve a props data in Vuejs and record to POST API with modal

I would like to retrieve the data “project.id” to record it when I click on the button “add study”. When I click on this button, I send the name and the status but i would like to send the id of project too via my API. Si this is the code :

JavaScript

And the javascript :

JavaScript

How can I add my id of my project in my axios lines to send it ? Thanks for your help

Advertisement

Answer

You should determine the current project.id with a container in data scope for the Add study handler sendClick() with passing project.id to showModalStudy() to overwrite the defined data currentId for the next API call

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement