Revert "Add cache clear ubutton"

This reverts commit 5597574dad.
This commit is contained in:
Mahad Kalam 2026-02-11 01:10:23 +00:00
parent 5597574dad
commit 25d8035cff
4 changed files with 1 additions and 27 deletions

View file

@ -1,11 +0,0 @@
class Admin::CacheController < Admin::BaseController
def clear
unless current_user&.admin_level_superadmin?
redirect_to root_path, alert: "Not authorized"
return
end
Rails.cache.clear
redirect_back fallback_location: root_path, notice: "Cache cleared successfully"
end
end

View file

@ -13,9 +13,7 @@ class InertiaController < ApplicationController
csrf_token: form_authenticity_token,
signout_path: signout_path,
show_stop_impersonating: session[:impersonater_user_id].present?,
stop_impersonating_path: stop_impersonating_path,
is_superadmin: current_user&.admin_level_superadmin? || false,
clear_cache_path: current_user&.admin_level_superadmin? ? admin_clear_cache_path : nil
stop_impersonating_path: stop_impersonating_path
}
end

View file

@ -61,8 +61,6 @@
signout_path: string;
show_stop_impersonating: boolean;
stop_impersonating_path: string;
is_superadmin: boolean;
clear_cache_path?: string | null;
};
let { layout, children }: { layout: LayoutProps; children?: () => unknown } =
@ -315,16 +313,6 @@
{/if}
</a>
{/each}
{#if layout.is_superadmin && layout.clear_cache_path}
<a
href={layout.clear_cache_path}
onclick={(e) => { e.preventDefault(); router.post(layout.clear_cache_path); }}
class="{navLinkClass(false)} superadmin-tool cursor-pointer"
>
Clear cache
</a>
{/if}
</div>
{/if}

View file

@ -39,7 +39,6 @@ Rails.application.routes.draw do
post :toggle_verified
end
end
post :clear_cache, to: "cache#clear", as: :clear_cache
end
end