-
In my system I make a CRUD operation and after make a refresh followed by a preload in all related models, this was working normally for belongsTo, but in hasOne relationship return an error when the id is null, look the code: await sector.refresh()
await sector.load((loader) => {
loader.preload('supervisor').preload('coordinator')
.preload('manager').preload('department')
}) The exception returned:
But in belongsTo relationship this code work. |
Beta Was this translation helpful? Give feedback.
Answered by
arthurcvm
May 20, 2021
Replies: 1 comment 3 replies
-
I understood the docs, in Sector I set belongsTo and in Supervisor I set hasOne, this way it works. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
arthurcvm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I understood the docs, in Sector I set belongsTo and in Supervisor I set hasOne, this way it works.