fix(frontend): fix lint and type errors in tier selector

- Replace template literal with regular string for static URL
- Fix TypeScript cast via intermediate `unknown` for tier field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zamil Majdy
2026-03-27 23:43:28 +00:00
parent dbfc791357
commit 2aac78eae4
2 changed files with 10 additions and 12 deletions

View File

@@ -42,7 +42,8 @@ export function RateLimitDisplay({
const [isChangingTier, setIsChangingTier] = useState(false);
const { toast } = useToast();
const currentTier = ((data as Record<string, unknown>).tier as Tier) ?? "PRO";
const currentTier =
((data as unknown as Record<string, unknown>).tier as Tier) ?? "PRO";
async function handleReset() {
const msg = resetWeekly

View File

@@ -202,17 +202,14 @@ export function useRateLimitManager() {
async function handleTierChange(newTier: string) {
if (!rateLimitData) return;
const response = await fetch(
`/api/copilot/admin/rate_limit/tier`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
user_id: rateLimitData.user_id,
tier: newTier,
}),
},
);
const response = await fetch("/api/copilot/admin/rate_limit/tier", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
user_id: rateLimitData.user_id,
tier: newTier,
}),
});
if (!response.ok) {
throw new Error("Failed to update tier");