chore(admin): remove query slop (dead wrappers, ghost invalidations)#276

merged1
fix/admin-product-stock-price
chore/admin-query-slop-cleanup
openedAug 22, 2026byAAviddaram
View on GitHubTwo-way sync enabledPR last imported 20d ago

Stacked on #275.

Changes

  • inline deleteHelper wrappers into the RowActions prop in three cards
  • drop getAllOrders invalidations from order-form: no component observes that query, they were marking ghost cache entries
  • order edit form now also invalidates getOrderById so the detail page refreshes after saving from the card dialog

Verification

  • typecheck clean
  • manual: delete a product/brand/category from row actions still works

Checks

4 successful · 1 skipped
All checks passed
8f48aed
Synced from GitHub

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • v2

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b5e292e-3da4-4a3f-a684-fcea03aab185

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Synced from GitHub

Greptile Summary

This PR removes unnecessary delete callback wrappers and obsolete order-query invalidations while adding targeted detail-query refresh after order edits.

  • Inlines equivalent delete mutation callbacks in brand, category, and product cards.
  • Invalidates the edited order’s getOrderById cache entry and the paginated order list.
  • Removes getAllOrders invalidations for a query that the admin application does not observe.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The inlined delete callbacks preserve existing behavior, and the revised order invalidations target all currently observed admin query keys without leaving a reachable stale cache.

Important Files Changed

FilenameOverview
apps/admin/src/components/brands/brand-card.tsxReplaces an unobserved async delete wrapper with an equivalent inline mutation callback.
apps/admin/src/components/categories/category-card.tsxReplaces an unobserved async delete wrapper with an equivalent inline mutation callback.
apps/admin/src/components/order/order-form.tsxRemoves ghost all-orders invalidations and adds a correctly keyed order-detail invalidation after edits.
apps/admin/src/components/product/product-card.tsxInlines the product delete mutation without changing RowActions behavior.

Reviews (1): Last reviewed commit: "chore(admin): remove query slop left ove..." | Re-trigger Greptile

Added 1 commit

  • chore(admin): remove query slop left over from earlier iterations8f48aed