Skip to content

Commit a28f5b1

Browse files
thesocialdevclaude
andcommitted
fix: simplify draft save payload to match working autoSaveDraft pattern
✅ Remove unnecessary fields from draft payload to match useAutoSaveDraft hook ✅ Keep only data_hash and machine fields that backend expects ✅ Add console logging for debugging payload structure ✅ Ensure API call matches working auto-save implementation exactly The working useAutoSaveDraft hook only sends data_hash and machine fields, so our manual draft save should use the same minimal payload structure. This ensures compatibility with the existing backend endpoint. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4d5e457 commit a28f5b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/ClaimReview/form/DynamicReviewTaskForm.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const DynamicReviewTaskForm = ({ data_hash, personality, target, canInteract = t
276276

277277
const formData = getValues();
278278
const draftPayload = {
279-
data_hash,
279+
data_hash, // This will be used for the URL parameter
280280
machine: {
281281
context: {
282282
reviewData: {
@@ -294,15 +294,14 @@ const DynamicReviewTaskForm = ({ data_hash, personality, target, canInteract = t
294294
},
295295
},
296296
},
297-
reportModel,
298-
reviewTaskType,
299-
nameSpace,
300297
};
301298

299+
console.log('Sending draft payload:', draftPayload);
302300
await reviewTaskApi.autoSaveDraft(draftPayload, t);
303301

304302
} catch (error) {
305303
console.error('Error saving draft:', error);
304+
console.error('Error details:', error.response?.data);
306305
} finally {
307306
setIsLoading((current) => ({ ...current, [ReviewTaskEvents.draft]: false }));
308307
}

0 commit comments

Comments
 (0)