diff --git a/src/client/pages/YieldStudyDashboard.tsx b/src/client/pages/YieldStudyDashboard.tsx index 3ad93d4..ac97104 100644 --- a/src/client/pages/YieldStudyDashboard.tsx +++ b/src/client/pages/YieldStudyDashboard.tsx @@ -112,7 +112,7 @@ export const YieldStudyDashboard: React.FC = () => { ...s, categories: (s.categories || []).map(cat => ({ ...cat, - id: cat.id || (cat as any)._id // Garante ID único + id: cat.id || (cat as { _id?: string })._id // Garante ID único })) })); @@ -158,7 +158,7 @@ export const YieldStudyDashboard: React.FC = () => { const res = await yieldStudyService.createStudy(newStudy); const normalized = { ...res.data, - categories: res.data.categories.map((cat: any) => ({ + categories: res.data.categories.map((cat: PieceCategory & { _id?: string }) => ({ ...cat, id: cat.id || cat._id })) @@ -226,7 +226,7 @@ export const YieldStudyDashboard: React.FC = () => { // 1. Aplica a atualização na categoria específica const newCategories = selectedStudy.categories.map(c => { - const currentId = c.id || (c as any)._id; + const currentId = c.id || (c as { _id?: string })._id; return currentId === id ? { ...c, ...updates } : c; }); @@ -432,7 +432,7 @@ export const YieldStudyDashboard: React.FC = () => { ...study, categories: study.categories.map(cat => ({ ...cat, - id: cat.id || (cat as any)._id + id: cat.id || (cat as { _id?: string })._id })) }; setSelectedStudy(normalized); diff --git a/src/server/routes/userRoutes.ts b/src/server/routes/userRoutes.ts index cddf747..de69490 100644 --- a/src/server/routes/userRoutes.ts +++ b/src/server/routes/userRoutes.ts @@ -1,5 +1,5 @@ import express from 'express'; -import { syncUser, getCurrentUser, getAllUsers, updateUserRole, toggleBanUser, heartbeat, getActiveUsers, deleteUser, login } from '../controllers/userController.js'; +import { getCurrentUser, getAllUsers, updateUserRole, toggleBanUser, heartbeat, getActiveUsers, deleteUser, login } from '../controllers/userController.js'; import { requireAdmin } from '../middleware/authMiddleware.js'; const router = express.Router();