Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions packages/core-data/src/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { getSyncManager } from './sync';
import {
applyPostChangesToCRDTDoc,
defaultCollectionSyncConfig,
defaultSyncConfig,
getPostChangesFromCRDTDoc,
POST_META_KEY_FOR_CRDT_DOC_PERSISTENCE,
} from './utils/crdt';
Expand Down Expand Up @@ -475,7 +474,7 @@ async function loadTaxonomyEntities() {
} );
return Object.entries( taxonomies ?? {} ).map( ( [ name, taxonomy ] ) => {
const namespace = taxonomy?.rest_namespace ?? 'wp/v2';
const entity = {
return {
kind: 'taxonomy',
baseURL: `/${ namespace }/${ taxonomy.rest_base }`,
baseURLParams: { context: 'edit' },
Expand All @@ -484,10 +483,6 @@ async function loadTaxonomyEntities() {
getTitle: ( record ) => record?.name,
supportsPagination: true,
};

entity.syncConfig = defaultSyncConfig;

return entity;
} );
}

Expand Down
18 changes: 18 additions & 0 deletions packages/core-data/src/test/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,22 @@ describe( 'loadTaxonomyEntities', () => {

expect( entities[ 0 ].supportsPagination ).toBe( true );
} );

it( 'should not enable entity syncing for taxonomy term records', async () => {
const mockTaxonomies = {
category: {
name: 'Categories',
rest_base: 'categories',
},
};

apiFetch.mockResolvedValueOnce( mockTaxonomies );

const taxonomyLoader = additionalEntityConfigLoaders.find(
( loader ) => loader.kind === 'taxonomy'
);
const entities = await taxonomyLoader.loadEntities();

expect( entities[ 0 ].syncConfig ).toBeUndefined();
} );
} );
Loading