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