Hello.
I updated Vuex ORM to latest 0.34.1 from 0.33.0.
However I realized there is a breaking changes for me.
The value of object passed as argument of insertOrUpdate will be changed inside the method.
Here are an example.
https://codesandbox.io/s/vuex-orm-template-2l8nq
class Profile extends Model {
static entity = "profiles";
static fields() {
return {
id: this.attr(null),
user_id: this.attr(null),
age: this.attr("")
};
}
}
class User extends Model {
static entity = "users";
static fields() {
return {
id: this.attr(null),
name: this.attr(""),
profile: this.hasOne(Profile, "user_id")
};
}
}
const user = {
id: 1,
name: "Taro",
profile: {
id: 2,
user_id: 1,
age: 25
}
};
this.before = user.profile; // { "id": 2, "user_id": 1, "age": 25, "$id": "2" }
User.insertOrUpdate({ data: user });
this.after = user.profile; // 2
When I use v0.33.0 the value of this.before and this.after are same, but v0.34.x it are different.
Hello.
I updated Vuex ORM to latest 0.34.1 from 0.33.0.
However I realized there is a breaking changes for me.
The value of object passed as argument of insertOrUpdate will be changed inside the method.
Here are an example.
https://codesandbox.io/s/vuex-orm-template-2l8nq
When I use v0.33.0 the value of
this.beforeandthis.afterare same, but v0.34.x it are different.