EditModelModal.jsx
15.2 KB
-
🚀 refactor: refine pricing refresh logic & hide disabled models · cfb5b602Summary ------- 1. Pricing generation • `model/pricing.go`: skip any model whose `status != 1` when building `pricingMap`, ensuring disabled models are never returned to the front-end. 2. Cache refresh placement • `controller/model_meta.go` – Removed `model.RefreshPricing()` from pure read handlers (`GetAllModelsMeta`, `SearchModelsMeta`). – Kept refresh only in mutating handlers (`Create`, `Update`, `Delete`), guaranteeing data is updated immediately after an admin change while avoiding redundant work on every read. Result ------ Front-end no longer receives information about disabled models, and pricing cache refreshes occur exactly when model data is modified, improving efficiency and consistency.t0ng7u committed