Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Refactor Post Author component #33695

Merged
merged 9 commits into from
Jul 27, 2021
Prev Previous commit
Next Next commit
Only set search query argument when we have filter value
  • Loading branch information
Mamaduka committed Jul 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 29cd70b15f32457d61af20977659516a5071475a
9 changes: 5 additions & 4 deletions packages/editor/src/components/post-author/combobox.js
Original file line number Diff line number Diff line change
@@ -28,10 +28,11 @@ function PostAuthorCombobox() {
const author = getUser( getEditedPostAttribute( 'author' ), {
context: 'view',
} );
const query = {
search: ! fieldValue ? undefined : fieldValue,
...AUTHORS_QUERY,
};
const query = { ...AUTHORS_QUERY };

if ( fieldValue ) {
query.search = fieldValue;
}

return {
authorId: getEditedPostAttribute( 'author' ),