From 091c77bdb1f05263543f85f5c6f04f5bfaf3c722 Mon Sep 17 00:00:00 2001 From: James Tsai Date: Thu, 30 Jul 2020 18:55:36 +0800 Subject: [PATCH] Refactor, change response type to json in update-api user online checking Signed-off-by: James Tsai --- lib/note/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/note/index.js b/lib/note/index.js index de401883..be4f8ace 100644 --- a/lib/note/index.js +++ b/lib/note/index.js @@ -283,7 +283,7 @@ const updateNote = async (req, res) => { if (realtime.isNoteExistsInPool(noteId)) { logger.error('Update note failed: There are online users opening this note.') - return res.status('403').send({ status: 'error', message: 'Update API can only be used when no users is online' }) + return res.status('403').json({ status: 'error', message: 'Update API can only be used when no users is online' }) } const now = Date.now()