Ran the following code + confirmed things worked as expected
```
const TEST_COMMUNITY_1: CommunityInfo = {
enabledApps: {
calendar: false,
wiki: false,
tasks: true,
files: true,
},
};
const TEST_COMMUNITY_2: CommunityInfo = {
enabledApps: {
calendar: true,
wiki: false,
tasks: false,
files: false,
},
};
const databaseModule = await getDatabaseModule();
let data = await databaseModule.schedule({
type: workerRequestMessageTypes.GET_CLIENT_STORE,
});
console.log(data.store.communites);
await databaseModule.schedule({
type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
storeOperations: {
communityStoreOperations: [
{
type: 'replace_community',
payload: {
id: '1',
communityInfo: TEST_COMMUNITY_1,
},
},
{
type: 'replace_community',
payload: {
id: '2',
communityInfo: TEST_COMMUNITY_2,
},
},
],
},
});
data = await databaseModule.schedule({
type: workerRequestMessageTypes.GET_CLIENT_STORE,
});
console.log(data.store.communites);
const community2Updated: CommunityInfo = {
enabledApps: {
calendar: true,
wiki: true,
tasks: true,
files: true,
},
};
await databaseModule.schedule({
type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
storeOperations: {
communityStoreOperations: [
{
type: 'replace_community',
payload: {
id: '2',
communityInfo: community2Updated,
},
},
],
},
});
data = await databaseModule.schedule({
type: workerRequestMessageTypes.GET_CLIENT_STORE,
});
console.log(data.store.communites);
await databaseModule.schedule({
type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
storeOperations: {
communityStoreOperations: [
{
type: 'remove_communites',
payload: {
ids: ['1'],
},
},
],
},
});
data = await databaseModule.schedule({
type: workerRequestMessageTypes.GET_CLIENT_STORE,
});
console.log(data.store.communities);
await databaseModule.schedule({
type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
storeOperations: {
communityStoreOperations: [
{
type: 'remove_all_communities',
},
],
},
});
data = await databaseModule.schedule({
type: workerRequestMessageTypes.GET_CLIENT_STORE,
});
console.log(data);
```