Fix bug
This commit is contained in:
parent
382b1d2250
commit
ecc235c545
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||||
import Note from '../../../../models/note';
|
import Note from '../../../../models/note';
|
||||||
import deleteNote from '../../../../services/note/delete';
|
import deleteNote from '../../../../services/note/delete';
|
||||||
import { ILocalUser } from '../../../../models/user';
|
import User, { ILocalUser } from '../../../../models/user';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
desc: {
|
desc: {
|
||||||
|
@ -32,7 +32,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||||
return rej('access denied');
|
return rej('access denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
await deleteNote(user, note);
|
await deleteNote(await User.findOne({ _id: note.userId }), note);
|
||||||
|
|
||||||
res();
|
res();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue