Skip to content

Conversation

@erenkurnaz
Copy link
Contributor

@erenkurnaz erenkurnaz commented Sep 8, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

The header search component in both finefoods-antd and finefoods-material-ui examples was making unnecessary API calls when the search input was empty. This caused performance issues and unnecessary network requests every time the search value changed to an empty string.

What is the new behavior?

Added a guard condition to prevent API calls when the search input is empty or contains only whitespace. The search functionality now only triggers API calls when there's actual search content, improving performance and reducing unnecessary network traffic.

Changes made:

  • Added if (value?.trim() === "") return; check in the useEffect hook for both examples
  • This prevents refetchOrders() and refetchCouriers() calls when search input is empty

fixes #6982

Notes for reviewers

  • The fix is minimal and consistent across both admin template examples (finefoods-antd and finefoods-material-ui)
  • The change only affects the search behavior when input is empty - all other functionality remains unchanged

@erenkurnaz erenkurnaz requested a review from a team as a code owner September 8, 2025 08:19
@erenkurnaz erenkurnaz linked an issue Sep 8, 2025 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2025

⚠️ No Changeset found

Latest commit: 4297461

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Sep 8, 2025

Deploy Preview for refine-doc-live-previews ready!

Name Link
🔨 Latest commit 4297461
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/68be9197d74cf70008b562f4
😎 Deploy Preview https://deploy-preview-6988--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

@erenkurnaz erenkurnaz merged commit 3920945 into main Sep 8, 2025
23 checks passed
@erenkurnaz erenkurnaz deleted the 6982-bug-admin-templates-not-working branch September 8, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Admin templates not working

3 participants