mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 19:58:39 +00:00
🔧 chore: Unify subscription plan status toggle with PATCH endpoint
Replace separate enable/disable flows with a single PATCH API that updates the enabled flag. Update frontend hooks and table actions to call the unified endpoint and keep UI behavior consistent. Introduce a minimal admin controller handler and route for the status update.
This commit is contained in:
@@ -27,16 +27,16 @@ import {
|
||||
import { getSubscriptionsColumns } from './SubscriptionsColumnDefs';
|
||||
|
||||
const SubscriptionsTable = (subscriptionsData) => {
|
||||
const { plans, loading, compactMode, openEdit, disablePlan, t } =
|
||||
const { plans, loading, compactMode, openEdit, setPlanEnabled, t } =
|
||||
subscriptionsData;
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return getSubscriptionsColumns({
|
||||
t,
|
||||
openEdit,
|
||||
disablePlan,
|
||||
setPlanEnabled,
|
||||
});
|
||||
}, [t, openEdit, disablePlan]);
|
||||
}, [t, openEdit, setPlanEnabled]);
|
||||
|
||||
const tableColumns = useMemo(() => {
|
||||
return compactMode
|
||||
|
||||
Reference in New Issue
Block a user