Answer the question
In order to leave comments, you need to log in
Why can deserialization fail?
When deserializing data, for some reason a wild glitch begins leading to constant calls to the server, we use ORM on the client side, something similar to this , but written under JSONAPI .
The problem started when the relations of the Vehicle model were nested with the Contract model, below is the short code:
Code of the Vehicle model:
export default class Vehicle extends Model {
static type() {
return 'vehicle'
}
static relationships() {
return {
contract: this.hasOne(Contract, 'contract')
}
}
}
export default class Contract extends Model {
static type() {
return 'contract'
}
static relationships() {
return {
vehicles: this.hasMany(Vehicle, 'vehicles', true)
}
}
}
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