fixed search results after removing chips from effective message bundles (#26839)

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>
Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2024-02-07 08:16:41 +00:00 committed by GitHub
parent 516bfbe896
commit b7bb37867d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,6 +116,16 @@ export const EffectiveMessageBundles = ({
const loader = async () => { const loader = async () => {
try { try {
const filter = getValues(); const filter = getValues();
const requiredKeys = ["theme", "themeType", "locale"];
const shouldReturnEmpty = requiredKeys.some(
(key) => !filter[key as keyof EffectiveMessageBundlesSearchForm],
);
if (shouldReturnEmpty) {
return [];
}
const messages = await adminClient.serverInfo.findEffectiveMessageBundles( const messages = await adminClient.serverInfo.findEffectiveMessageBundles(
{ {
realm, realm,