Add clear_ai_cache endpoint to rules controller

Add POST /rules/clear_ai_cache route and controller action to trigger AI cache clearing for the current family.
This commit is contained in:
eureka928
2026-01-26 09:46:26 +01:00
parent 46ab1d8373
commit b511b3add9
2 changed files with 6 additions and 0 deletions

View File

@@ -128,6 +128,11 @@ class RulesController < ApplicationController
redirect_back_or_to rules_path, notice: t("rules.apply_all.success")
end
def clear_ai_cache
ClearAiCacheJob.perform_later(Current.family)
redirect_to rules_path, notice: "AI cache is being cleared. This may take a few moments."
end
private
def set_rule
@rule = Current.family.rules.find(params[:id])

View File

@@ -292,6 +292,7 @@ Rails.application.routes.draw do
delete :destroy_all
get :confirm_all
post :apply_all
post :clear_ai_cache
end
end