Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rafidAhsan's avatar

Passing form data but it is turning into full state when I am calling actions

My action is not receiving the correct payload that I am giving. Instead it is gicing my full state to the server

On template

data() {
    return {
      detailsForm: {
        first_name: null,
        middle_name: null,
        last_name: null,
      },
  },

methods: {
    submitBasicDetails() {
      console.log(this.detailsForm)
      store.dispatch('candidateProfile/basicDetails', this.detailsForm)
    },
  },

on vuex actions

export default {
  profileImage: payload =>console.log(payload)
}

first output from template is:

{__ob__: Observer}
first_name:  (...)
last_name: (...)
middle_name: (...)

...

which is ok but I know dont why actions is returning this output

{getters: {…}, state: {…}, rootGetters: {…}, dispatch: ƒ, commit: ƒ, …}
commit:  ƒ (_type, _payload, _options)
dispatch:  ƒ (_type, _payload, _options)
getters: {}
rootGetters : {}
rootState: {…}
state: {__ob__: Observer}
[[Prototype]]:  Object

I don't know how it's possible

0 likes
0 replies

Please or to participate in this conversation.