From ea49a72192137127ef97ef2c93316a9b42cab2f6 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Wed, 28 Jun 2023 02:19:56 +0200 Subject: [PATCH] ToDo app: Change owner on members when changing owner of realm --- .../src/components/access-control/EditMemberAccess.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/dexie-cloud-todo-app/src/components/access-control/EditMemberAccess.tsx b/samples/dexie-cloud-todo-app/src/components/access-control/EditMemberAccess.tsx index 51a6afd23..4763e31d2 100644 --- a/samples/dexie-cloud-todo-app/src/components/access-control/EditMemberAccess.tsx +++ b/samples/dexie-cloud-todo-app/src/components/access-control/EditMemberAccess.tsx @@ -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: