diff --git a/apps/cursor/src/actions/review-plugin.ts b/apps/cursor/src/actions/review-plugin.ts index e559706d..94fb02df 100644 --- a/apps/cursor/src/actions/review-plugin.ts +++ b/apps/cursor/src/actions/review-plugin.ts @@ -16,7 +16,7 @@ export const approvePluginAction = adminActionClient const { error } = await supabase .from("plugins") - .update({ active: true }) + .update({ active: true, status: "approved" }) .eq("id", pluginId); if (error) { @@ -70,7 +70,7 @@ export const declinePluginAction = adminActionClient const { error } = await supabase .from("plugins") - .delete() + .update({ active: false, status: "declined" }) .eq("id", pluginId); if (error) { diff --git a/apps/cursor/src/app/admin/plugins/page.tsx b/apps/cursor/src/app/admin/plugins/page.tsx index 7ad0b145..e6d2d80f 100644 --- a/apps/cursor/src/app/admin/plugins/page.tsx +++ b/apps/cursor/src/app/admin/plugins/page.tsx @@ -1,9 +1,9 @@ -import { getPendingPlugins } from "@/data/queries"; +import { getDeclinedPlugins, getPendingPlugins } from "@/data/queries"; import { isAdmin } from "@/utils/admin"; import { getSession } from "@/utils/supabase/auth"; import type { Metadata } from "next"; import { redirect } from "next/navigation"; -import { PluginReviewList } from "./plugin-review-list"; +import { PluginReviewTabs } from "./plugin-review-tabs"; export const metadata: Metadata = { title: "Review Plugins | Admin", @@ -16,22 +16,22 @@ export default async function AdminPluginsPage() { redirect("/"); } - const { data: plugins } = await getPendingPlugins({ - since: "2026-03-16T00:00:00Z", - }); + const [{ data: plugins }, { data: declined }] = await Promise.all([ + getPendingPlugins({ since: "2026-03-16T00:00:00Z" }), + getDeclinedPlugins({ since: "2026-03-16T00:00:00Z" }), + ]); return (
- {plugins?.length ?? 0} pending{" "} - {plugins?.length === 1 ? "submission" : "submissions"} -