Closed dorkster100 closed 2 months ago
This should never be null.
Can you please elaborate a bit? Should users be not deleteable or do you think if user is deleted, then the team should be deleted as well or team should automatically get new owner?
Actually nevermind, I see in the DeleteUser
action that idea is to delete all owned teams.
Team->allUsers()
may error out, if$this->owner
isnull
. This may happen if user was deleted (team owner has no foreign index ), meaning user referenced inuser_id
column will not exist inusers
table, thus returning null. In this case$this->users->merge([null])
which errors.On further work on my features I found more issues, for example when adding team members, the owner is expected in the stub
AddTeamMember
, I believe it should be possible to add team members to a team without owner (for example in my case I have Admin users).