fix: type authService.login, replace remaining console.error with logger
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
958d40896c
commit
2f46712789
6 changed files with 12 additions and 7 deletions
|
|
@ -5,6 +5,7 @@ import { Input } from '../ui/input';
|
|||
import { Search, Filter, History, User, Globe, Loader2 } from 'lucide-react';
|
||||
import { adminService } from '../../services/adminService';
|
||||
import { format } from 'date-fns';
|
||||
import { logger } from '@/utils/logger';
|
||||
|
||||
export const AdminAuditLogsView: React.FC = () => {
|
||||
const [logs, setLogs] = useState<any[]>([]);
|
||||
|
|
@ -19,7 +20,7 @@ export const AdminAuditLogsView: React.FC = () => {
|
|||
setLogs(data.logs || []);
|
||||
setTotal(data.pagination?.total_items || 0);
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch audit logs', e);
|
||||
logger.error('Failed to fetch audit logs', { error: e });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { useState, useCallback } from 'react';
|
||||
import { useToast } from '@/components/feedback/ToastProvider';
|
||||
import { productService, CreateProductData } from '@/services/productService';
|
||||
import { logger } from '@/utils/logger';
|
||||
import type { LicenseConfig } from './types';
|
||||
|
||||
const INITIAL_LICENSES: LicenseConfig[] = [
|
||||
|
|
@ -60,7 +61,7 @@ export function useCreateProductView() {
|
|||
setDescription('');
|
||||
} catch (e) {
|
||||
addToast('Failed to publish product', 'error');
|
||||
console.error(e);
|
||||
logger.error('Failed to publish product', { error: e });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button';
|
|||
import { Shield, ShieldCheck, ShieldAlert, Loader2 } from 'lucide-react';
|
||||
import { twoFactorService } from '@/services/2fa-service';
|
||||
import { TwoFactorSetup } from '@/components/settings/security/TwoFactorSetup';
|
||||
import { logger } from '@/utils/logger';
|
||||
|
||||
export const TwoFactorSettings: React.FC = () => {
|
||||
const [enabled, setEnabled] = useState<boolean | null>(null);
|
||||
|
|
@ -16,7 +17,7 @@ export const TwoFactorSettings: React.FC = () => {
|
|||
const status = await twoFactorService.getStatus();
|
||||
setEnabled(status.enabled);
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch 2FA status', e);
|
||||
logger.error('Failed to fetch 2FA status', { error: e });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { useEffect, useState, useCallback, useRef } from 'react';
|
||||
import { logger } from '@/utils/logger';
|
||||
|
||||
/**
|
||||
* Edge 3.3: Hook to track and handle tab visibility changes
|
||||
|
|
@ -44,7 +45,7 @@ export function useTabVisibility() {
|
|||
try {
|
||||
callback();
|
||||
} catch (error) {
|
||||
console.error('[useTabVisibility] Error in onHidden callback:', error);
|
||||
logger.error('[useTabVisibility] Error in onHidden callback', { error });
|
||||
}
|
||||
});
|
||||
} else if (!wasVisible && nowVisible) {
|
||||
|
|
@ -53,7 +54,7 @@ export function useTabVisibility() {
|
|||
try {
|
||||
callback();
|
||||
} catch (error) {
|
||||
console.error('[useTabVisibility] Error in onVisible callback:', error);
|
||||
logger.error('[useTabVisibility] Error in onVisible callback', { error });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const mapUserDTO = (dto: UserDTO): User => ({
|
|||
});
|
||||
|
||||
export const authService = {
|
||||
login: async (credentials: any) => {
|
||||
login: async (credentials: LoginCredentials) => {
|
||||
const response = await apiClient.post<{
|
||||
user: UserDTO;
|
||||
access_token: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { webhookService } from './webhookService';
|
||||
import { logger } from '@/utils/logger';
|
||||
|
||||
interface ApiKey {
|
||||
id: string;
|
||||
|
|
@ -148,7 +149,7 @@ export const developerService = {
|
|||
const hooks = await webhookService.list();
|
||||
webhookCount = hooks.length;
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch webhook stats', e);
|
||||
logger.error('Failed to fetch webhook stats', { error: e });
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in a new issue