HomePhabricator
Diffusion Comm 571ae32fcd45

[sqlite] implement C++ community store ops

Description

[sqlite] implement C++ community store ops

Summary:
Introduced all the necessary code for native ops for modifying the community store

Linear task: https://linear.app/comm/issue/ENG-6532/implement-c-community-store-ops

Depends on D11151

Test Plan:
Ran the following code:

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,
  },
};

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'replace_community',
    payload: {
      id: '1',
      communityInfo: TEST_COMMUNITY_1,
    },
  },
  {
    type: 'replace_community',
    payload: {
      id: '2',
      communityInfo: TEST_COMMUNITY_2,
    },
  },
]);

const community2Updated: CommunityInfo = {
  enabledApps: {
    calendar: true,
    wiki: true,
    tasks: true,
    files: true,
  },
};

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'replace_community',
    payload: {
      id: '2',
      communityInfo: community2Updated,
    },
  },
]);

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'remove_communities',
    payload: {
      ids: ['1'],
    },
  },
]);

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'remove_all_communities',
  },
]);

Reviewers: atul, inka, kamil

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11152

Details

Provenance
ginsuAuthored on Feb 20 2024, 12:54 PM
Reviewer
kamil
Differential Revision
D11152: [sqlite] implement C++ community store ops
Parents
rCOMM68a6672a3569: [sqlite] add methods to operate on communities table
Branches
Unknown
Tags
Unknown