🚀 Auto-deploy: GPI atualizado em 27/08/2026 16:50:56
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user