handleSubmit() {
this.$store.dispatch("updateProduct", {
name: this.form.name,
price: "$" + this.form.price,
brand: this.form.brand,
inventoryStatus: this.form.inventoryStatus === "true",
})
updateProduct: async ({ commit }, payload) => {
try {
console.log(payload.id)
let result = await axios.put(`http://localhost:3000/products/${payload.id}`, payload);
commit('UPDATE_PRODUCT', result.data)
} catch (error) {
throw new Error('api update error:', error)
}
}