mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-02 20:15:55 +02:00
Refactorijg
This commit is contained in:
16
src/server/api/endpoints/games/reversi/invitations.ts
Normal file
16
src/server/api/endpoints/games/reversi/invitations.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import Matching, { pack as packMatching } from '../../../../../models/games/reversi/matching';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Find session
|
||||
const invitations = await Matching.find({
|
||||
childId: user._id
|
||||
}, {
|
||||
sort: {
|
||||
_id: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Reponse
|
||||
res(Promise.all(invitations.map(async (i) => await packMatching(i, user))));
|
||||
});
|
||||
Reference in New Issue
Block a user