fix(audit): P2 frontend any→concrete types (181→61), heroicons→lucide-react, missing type exports, toast API, Select options, TaskStatus types; P2-9 hooks.py type annotations
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { asError } from '@/utils/errorTypes';
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useForm } from 'react-hook-form';
|
||||
@@ -47,8 +48,8 @@ export function SettingsCurrenciesPage() {
|
||||
try {
|
||||
const data = await apiGet<{ items: Currency[]; total: number }>('/currencies');
|
||||
setCurrencies(data.items);
|
||||
} catch (err: any) {
|
||||
setError(err.message || t('common.error'));
|
||||
} catch (err: unknown) { const errObj = asError(err);
|
||||
setError(errObj.message || t('common.error'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -67,8 +68,8 @@ export function SettingsCurrenciesPage() {
|
||||
setEditing(null);
|
||||
reset({ code: '', name: '', symbol: '', is_default: false });
|
||||
await fetchCurrencies();
|
||||
} catch (err: any) {
|
||||
setError(err.message || t('common.error'));
|
||||
} catch (err: unknown) { const errObj = asError(err);
|
||||
setError(errObj.message || t('common.error'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,8 +78,8 @@ export function SettingsCurrenciesPage() {
|
||||
try {
|
||||
await apiDelete(`/currencies/${id}`);
|
||||
await fetchCurrencies();
|
||||
} catch (err: any) {
|
||||
setError(err.message || t('common.error'));
|
||||
} catch (err: unknown) { const errObj = asError(err);
|
||||
setError(errObj.message || t('common.error'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user