diff options
Diffstat (limited to 'src/server/api/endpoints/notes/conversation.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/conversation.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/api/endpoints/notes/conversation.ts b/src/server/api/endpoints/notes/conversation.ts index 02f7229ccf..b2bc6a2e72 100644 --- a/src/server/api/endpoints/notes/conversation.ts +++ b/src/server/api/endpoints/notes/conversation.ts @@ -1,13 +1,11 @@ -/** - * Module dependencies - */ import $ from 'cafy'; import ID from '../../../../cafy-id'; -import Note, { pack } from '../../../../models/note'; +import Note, { pack, INote } from '../../../../models/note'; +import { ILocalUser } from '../../../../models/user'; /** * Show conversation of a note */ -module.exports = (params, user) => new Promise(async (res, rej) => { +module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => { // Get 'noteId' parameter const [noteId, noteIdErr] = $.type(ID).get(params.noteId); if (noteIdErr) return rej('invalid noteId param'); @@ -29,10 +27,10 @@ module.exports = (params, user) => new Promise(async (res, rej) => { return rej('note not found'); } - const conversation = []; + const conversation: INote[] = []; let i = 0; - async function get(id) { + async function get(id: any) { i++; const p = await Note.findOne({ _id: id }); |