D
D
Dauren S2020-11-27 13:15:52
Django
Dauren S, 2020-11-27 13:15:52

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("/");
        });
    },
  },

What could be the matter, there are no CORS errors, the request normally flies 200 response

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dauren S, 2020-11-27
@dauren101

data=request.data
print(data)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question