Answer the question
In order to leave comments, you need to log in
When sending data from Vue.js post, back does not see it?
I send a request for django with vue.js post. If I do it with postmana, then Django sees everything perfectly,
but if I do it with Vue.js, it doesn’t.
const axios = require("axios").default;
axios.defaults.withCredentials = true;
methods: {
save: function () {
let savedate = event.target.getAttribute("date");
let time = event.target.getAttribute("time");
let slot = event.target.getAttribute("slot");
axios
.post(
process.env.VUE_APP_API + "/api/savemenu/",
{
dish_id: event.target.value,
date: savedate,
time: time,
slot: slot,
},
)
.then(
(response) => (
(this.personal = response["data"]["personal"]),
(this.checknorma = response["data"]["checknorma"])
)
)
.catch(function (error) {
error.data;
self.$router.push("/");
});
},
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question