wip
This commit is contained in:
@ -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 });
|
||||
|
||||
|
Reference in New Issue
Block a user