summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/conversation.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-18 09:54:53 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-18 09:54:53 +0900
commit80e5645a84cc60d76f79c48a3d565fb66ad88643 (patch)
tree1e2fc1c6c9ffb7989c5db997eae906c013433eda /src/server/api/endpoints/notes/conversation.ts
parentMerge pull request #1738 from rinsuki/features/ts-noimplicitany-true (diff)
downloadsharkey-80e5645a84cc60d76f79c48a3d565fb66ad88643.tar.gz
sharkey-80e5645a84cc60d76f79c48a3d565fb66ad88643.tar.bz2
sharkey-80e5645a84cc60d76f79c48a3d565fb66ad88643.zip
wip
Diffstat (limited to 'src/server/api/endpoints/notes/conversation.ts')
-rw-r--r--src/server/api/endpoints/notes/conversation.ts12
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 });