fix: resolve all admin typecheck errors (typed api wrapper, unused imports, missing hooks, PermissionButton children)

This commit is contained in:
2026-07-06 01:02:26 +08:00
parent 4a48a65a48
commit 6b0a21d266
22 changed files with 4051 additions and 273 deletions

View File

@@ -82,8 +82,8 @@ const ClassesPage: React.FC = () => {
const params: ClassQueryParams = {};
if (filterStatus) params.status = filterStatus;
if (filterType) params.classType = filterType;
const res = await api.get('/classes', { params });
setData(res as ClassItem[]);
const res = await api.get<ClassItem[]>('/classes', { params });
setData(res);
} catch (e) {
console.error(e);
} finally {
@@ -111,6 +111,7 @@ const ClassesPage: React.FC = () => {
setEditing(record);
form.setFieldsValue({
...record,
notes: record.notes ?? undefined,
startDate: record.startDate ? dayjs(record.startDate) : undefined,
endDate: record.endDate ? dayjs(record.endDate) : undefined,
});