Skip to content

Commit

Permalink
Remove type from object
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Jul 12, 2024
1 parent aa5018b commit f8adadb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/blocks/src/api/test/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,7 @@ describe( 'blocks', () => {
const source = {
name: 'core/test-source',
label: 'Test Source',
getValue: () => 'value',
};
registerBlockBindingsSource( source );
registerBlockBindingsSource( source );
Expand Down
5 changes: 3 additions & 2 deletions packages/blocks/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,11 @@ export function collections( state = {}, action ) {
export function blockBindingsSources( state = {}, action ) {
switch ( action.type ) {
case 'ADD_BLOCK_BINDINGS_SOURCE':
// Filter the name property and the undefined values.
// Filter the name property, the type property, and the undefined values.
const newProperties = Object.fromEntries(
Object.entries( action ).filter(
( [ key, value ] ) => value !== undefined && key !== 'name'
( [ key, value ] ) =>
value !== undefined && key !== 'name' && key !== 'type'
)
);

Expand Down

0 comments on commit f8adadb

Please sign in to comment.