mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-25 22:22:51 +09:00
serializers - posts: no need Promise wrapping
This commit is contained in:
parent
0ee6d65921
commit
7553c6dd38
@ -22,13 +22,13 @@ import rap from '@prezzemolo/rap';
|
|||||||
* @param options? serialize options
|
* @param options? serialize options
|
||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
const self = (
|
const self = async (
|
||||||
post: string | mongo.ObjectID | IPost,
|
post: string | mongo.ObjectID | IPost,
|
||||||
me?: string | mongo.ObjectID | IUser,
|
me?: string | mongo.ObjectID | IUser,
|
||||||
options?: {
|
options?: {
|
||||||
detail: boolean
|
detail: boolean
|
||||||
}
|
}
|
||||||
) => new Promise<any>(async (resolve, reject) => {
|
) => {
|
||||||
const opts = options || {
|
const opts = options || {
|
||||||
detail: true,
|
detail: true,
|
||||||
};
|
};
|
||||||
@ -184,7 +184,7 @@ const self = (
|
|||||||
// resolve promises in _post object
|
// resolve promises in _post object
|
||||||
_post = await rap(_post);
|
_post = await rap(_post);
|
||||||
|
|
||||||
resolve(_post);
|
return _post;
|
||||||
});
|
};
|
||||||
|
|
||||||
export default self;
|
export default self;
|
||||||
|
Loading…
Reference in New Issue
Block a user