Skip to content

fix: pass status filter in search index build for preview deploys#753

Draft
dante01yoon wants to merge 1 commit intomainfrom
fix/search-index-status-filter
Draft

fix: pass status filter in search index build for preview deploys#753
dante01yoon wants to merge 1 commit intomainfrom
fix/search-index-status-filter

Conversation

@dante01yoon
Copy link
Copy Markdown
Contributor

Summary

  • build-index.ts was calling /api/hub/workflows/index without ?status=, while hub-api.ts listWorkflowIndex() passes explicit status filters
  • On the test API (preview builds), the default response without status filter returns no workflows → empty search-index.json (0 documents) → text search completely broken on preview
  • Production was unaffected because the prod API returns approved workflows by default
  • Also fixed: empty array [] from API was treated as truthy, skipping the content collection fallback

Changes

  1. Pass ?status= query parameter matching hub-api.ts logic (PUBLIC_APPROVED_ONLY env var)
  2. Fall back to content collection when API returns empty array

Test plan

  • Deploy preview and verify search-index.json has documents (not 245 bytes)
  • Type a search query (e.g. "Grok") in the SearchPopover and confirm results appear
  • Verify production build still produces correct search index

🤖 Generated with Claude Code

build-index.ts was calling /api/hub/workflows/index without a ?status=
parameter, while hub-api.ts listWorkflowIndex() passes explicit status
filters. On the test API (used by preview builds), the default response
without status filter returns no workflows, producing an empty search
index. Production was unaffected because the prod API has approved
workflows returned by default.

Also fall back to content collection when the API returns an empty array
instead of treating [] as a successful result.
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Lint & Format Results

Check Status
ESLint ✅ success
Prettier ✅ success

Generated by Site CI workflow

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Preview deployed: https://workflow-templates-agxrhvc2b-comfyui.vercel.app

@github-actions
Copy link
Copy Markdown
Contributor

🔍 SEO Audit Results

Check Status
Sitemap Validation ✅ passed
SEO Audit ✅ passed
Internal Links ❓ skipped
📊 SEO Audit Details

Could not parse SEO output

🔗 Link Check Details

broken internal links out of checked


Generated by Site CI workflow

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.

1 participant