Refactored classes according to new convention
This commit is contained in:
@@ -10,7 +10,7 @@ import { requireUser } from '@kit/supabase/require-user';
|
||||
import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client';
|
||||
|
||||
import { DeletePersonalAccountSchema } from '../schema/delete-personal-account.schema';
|
||||
import { DeletePersonalAccountService } from './services/delete-personal-account.service';
|
||||
import { createDeletePersonalAccountService } from './services/delete-personal-account.service';
|
||||
|
||||
const emailSettings = getEmailSettingsFromEnvironment();
|
||||
|
||||
@@ -53,7 +53,7 @@ export async function deletePersonalAccountAction(formData: FormData) {
|
||||
const userEmail = auth.data.email ?? null;
|
||||
|
||||
// create a new instance of the personal accounts service
|
||||
const service = new DeletePersonalAccountService();
|
||||
const service = createDeletePersonalAccountService();
|
||||
|
||||
// delete the user's account and cancel all subscriptions
|
||||
await service.deletePersonalAccount({
|
||||
|
||||
@@ -5,6 +5,10 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
|
||||
export function createDeletePersonalAccountService() {
|
||||
return new DeletePersonalAccountService();
|
||||
}
|
||||
|
||||
/**
|
||||
* @name DeletePersonalAccountService
|
||||
* @description Service for managing accounts in the application
|
||||
@@ -13,7 +17,7 @@ import { Database } from '@kit/supabase/database';
|
||||
* const client = getSupabaseClient();
|
||||
* const accountsService = new DeletePersonalAccountService();
|
||||
*/
|
||||
export class DeletePersonalAccountService {
|
||||
class DeletePersonalAccountService {
|
||||
private namespace = 'accounts.delete';
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user