Deleted the billing-redirect-button, checkout-redirect-button, and embedded-stripe-checkout components. Additionally, removed the shadcn directory, which encompassed billing-related icons. This change streamlines the subscription settings interface and organizes the system's payment management. This update is a stepping stone towards improving the billing system's overall architecture.
30 lines
819 B
TypeScript
30 lines
819 B
TypeScript
'use server';
|
|
|
|
import { revalidatePath } from 'next/cache';
|
|
import { redirect } from 'next/navigation';
|
|
|
|
import { Logger } from '@kit/shared/logger';
|
|
import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client';
|
|
|
|
import { withAdminSession } from '~/admin/lib/actions-utils';
|
|
|
|
const getClient = () => getSupabaseServerActionClient({ admin: true });
|
|
|
|
export const deleteOrganizationAction = withAdminSession(
|
|
async ({ id }: { id: number; csrfToken: string }) => {
|
|
const client = getClient();
|
|
|
|
Logger.info({ id }, `Admin requested to delete Organization`);
|
|
|
|
await deleteOrganization(client, {
|
|
organizationId: id,
|
|
});
|
|
|
|
revalidatePath('/admin/organizations', 'page');
|
|
|
|
Logger.info({ id }, `Organization account deleted`);
|
|
|
|
redirect('/admin/organizations');
|
|
},
|
|
);
|