Skip to content
Merged
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
3 changes: 2 additions & 1 deletion packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ export function* saveEntityRecord(
name,
{ ...persistedEntity, ...data },
undefined,
true
// This must be false or it will trigger a GET request in parallel to the PUT/POST below
false
);

updatedRecord = yield apiFetch( {
Expand Down
8 changes: 6 additions & 2 deletions packages/core-data/src/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ describe( 'saveEntityRecord', () => {
'__experimentalGetEntityRecordNoResolver'
);
expect( fulfillment.next().value.type ).toBe( '@@data/SELECT' );
expect( fulfillment.next().value.type ).toBe( 'RECEIVE_ITEMS' );
const receiveItems = fulfillment.next().value;
expect( receiveItems.type ).toBe( 'RECEIVE_ITEMS' );
expect( receiveItems.invalidateCache ).toBe( false );
const { value: apiFetchAction } = fulfillment.next( {} );
expect( apiFetchAction.request ).toEqual( {
path: '/wp/v2/posts',
Expand Down Expand Up @@ -132,7 +134,9 @@ describe( 'saveEntityRecord', () => {
expect( fulfillment.next().value.type ).toBe( '@@data/SELECT' );
expect( fulfillment.next().value.type ).toBe( '@@data/SELECT' );
expect( fulfillment.next().value.type ).toBe( '@@data/SELECT' );
expect( fulfillment.next().value.type ).toBe( 'RECEIVE_ITEMS' );
const receiveItems = fulfillment.next().value;
expect( receiveItems.type ).toBe( 'RECEIVE_ITEMS' );
expect( receiveItems.invalidateCache ).toBe( false );
const { value: apiFetchAction } = fulfillment.next( {} );
expect( apiFetchAction.request ).toEqual( {
path: '/wp/v2/posts/10',
Expand Down