Skip to content
Advertisement

Crud Destroy isnt Destroying [closed]

Im doing my first CRUD(Vue-Laravel) and im getting an error in the backend.

My Laravel.Log:

JavaScript

My backend:

JavaScript

My frontend:

JavaScript

Advertisement

Answer

If you have a look at your front-end, you’ll see that you don’t specify an ID you want to delete.

You can fix that by replacing

await axios.delete("api/despesas/{despesa}").then((response) => {});

with

const response = await axios.delete("api/despesas/"+id).then((response) => {});

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