mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 23:55:58 +09:00
Refactor: Better type annotations
This commit is contained in:
parent
8ba3fb13eb
commit
429bf179dc
@ -1,3 +1,4 @@
|
|||||||
|
import * as mongo from 'mongodb';
|
||||||
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||||
import User, { ILocalUser } from '../../../../models/user';
|
import User, { ILocalUser } from '../../../../models/user';
|
||||||
import Note from '../../../../models/note';
|
import Note from '../../../../models/note';
|
||||||
@ -22,8 +23,8 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
|
|||||||
return rej('note not found');
|
return rej('note not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
let addedId;
|
let addedId: mongo.ObjectID;
|
||||||
let removedId;
|
let removedId: mongo.ObjectID;
|
||||||
|
|
||||||
const pinnedNoteIds = user.pinnedNoteIds || [];
|
const pinnedNoteIds = user.pinnedNoteIds || [];
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import renderRemove from '../../remote/activitypub/renderer/remove';
|
|||||||
import packAp from '../../remote/activitypub/renderer';
|
import packAp from '../../remote/activitypub/renderer';
|
||||||
import { deliver } from '../../queue';
|
import { deliver } from '../../queue';
|
||||||
|
|
||||||
export async function deliverPinnedChange(userId: mongo.ObjectID, oldId: mongo.ObjectID, newId: mongo.ObjectID) {
|
export async function deliverPinnedChange(userId: mongo.ObjectID, oldId?: mongo.ObjectID, newId?: mongo.ObjectID) {
|
||||||
const user = await User.findOne({
|
const user = await User.findOne({
|
||||||
_id: userId
|
_id: userId
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user