Skip to content

Commit da163fb

Browse files
committed
Fix inconsitent note response format
1 parent 729a91e commit da163fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/src/api/notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ router.put(
279279
return res.status(200).json({
280280
success: true,
281281
message: 'Note successfully updated',
282-
data: updatedNote,
282+
result: updatedNote,
283283
});
284284
} else {
285285
return res.status(404).json({

client/src/pages/Note.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const Note = ({ user }: NoteProps): Node => {
293293
.then((res) => {
294294
setSubmitState(SUBMIT_STATE.success);
295295
setIsFetching(false);
296-
history.push(`/notes/${res.data.data._id}`);
296+
history.push(`/notes/${res.data.result._id}`);
297297
return res;
298298
})
299299
.catch(() => setSubmitState(SUBMIT_STATE.error));

0 commit comments

Comments
 (0)