Skip to content

Commit

Permalink
ToDo app: Change owner on members when changing owner of realm
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Jun 28, 2023
1 parent 9286841 commit ea49a72
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ function changeAccess(
db.members
.where({ realmId, userId: todoList.owner })
.modify({ roles: ['manager'] });
// Change owner of all members in the realm:
db.members.where({ realmId }).modify({ owner: member.userId });
// Change owner of the todo list:
db.todoLists.update(todoList, { owner: member.userId });
// Change owner of realm:
Expand Down

0 comments on commit ea49a72

Please sign in to comment.