Update packages and refactor logging in diverse services
This commit updates diverse packages such as "@makerkit/data-loader-supabase-core" and "@makerkit/data-loader-supabase-nextjs" to the new versions in the package.json files. Also, several refactorings were done in logging within services and loaders by progressing 'server-only' imports and improving context handling. Additionally, type annotations have been added to several exported functions for better code readability and maintainability.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import 'server-only';
|
||||
|
||||
import { SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
|
||||
@@ -26,14 +26,13 @@ export class DeleteTeamAccountService {
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
logger.info(
|
||||
{
|
||||
name: this.namespace,
|
||||
accountId: params.accountId,
|
||||
userId: params.userId,
|
||||
},
|
||||
`Requested team account deletion. Processing...`,
|
||||
);
|
||||
const ctx = {
|
||||
accountId: params.accountId,
|
||||
userId: params.userId,
|
||||
name: this.namespace,
|
||||
};
|
||||
|
||||
logger.info(ctx, `Requested team account deletion. Processing...`);
|
||||
|
||||
// we can use the admin client to delete the account.
|
||||
const { error } = await adminClient
|
||||
@@ -44,9 +43,7 @@ export class DeleteTeamAccountService {
|
||||
if (error) {
|
||||
logger.error(
|
||||
{
|
||||
name: this.namespace,
|
||||
accountId: params.accountId,
|
||||
userId: params.userId,
|
||||
...ctx,
|
||||
error,
|
||||
},
|
||||
'Failed to delete team account',
|
||||
@@ -55,13 +52,6 @@ export class DeleteTeamAccountService {
|
||||
throw new Error('Failed to delete team account');
|
||||
}
|
||||
|
||||
logger.info(
|
||||
{
|
||||
name: this.namespace,
|
||||
accountId: params.accountId,
|
||||
userId: params.userId,
|
||||
},
|
||||
'Successfully deleted team account',
|
||||
);
|
||||
logger.info(ctx, 'Successfully deleted team account');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user