mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user