Return error response for missing or invalid note title and body in sync process
Despliegue Automático / desplegar (push) Successful in 1m1s

This commit is contained in:
2026-08-15 20:45:14 +02:00
parent e5ff445b90
commit a824717b5f
+2 -2
View File
@@ -117,8 +117,8 @@ class SyncService {
for (const incomingNote of incomingNotes) { for (const incomingNote of incomingNotes) {
const permanentDelete = Boolean(incomingNote.permanentDelete); const permanentDelete = Boolean(incomingNote.permanentDelete);
if (!incomingNote.id || (!permanentDelete && (!incomingNote.title || !incomingNote.body))) { if (!incomingNote.id || typeof incomingNote.title !== 'string' || typeof incomingNote.body !== 'string') {
throw new Error('Cada nota debe incluir id, title y body'); return res.status(400).json({ message: "Cada nota debe incluir id, title y body" });
} }
const incomingBaseVersion = getIncomingVersion('nota', incomingNote); const incomingBaseVersion = getIncomingVersion('nota', incomingNote);