mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-05 02:08:08 +09:00
Refactoring
This commit is contained in:
parent
3f66bce39e
commit
365915e7d2
@ -33,12 +33,12 @@ const self = (
|
|||||||
|
|
||||||
// Me
|
// Me
|
||||||
const meId: mongo.ObjectID = me
|
const meId: mongo.ObjectID = me
|
||||||
? mongo.ObjectID.prototype.isPrototypeOf(me)
|
? mongo.ObjectID.prototype.isPrototypeOf(me)
|
||||||
? me as mongo.ObjectID
|
? me as mongo.ObjectID
|
||||||
: typeof me === 'string'
|
: typeof me === 'string'
|
||||||
? new mongo.ObjectID(me)
|
? new mongo.ObjectID(me)
|
||||||
: (me as IUser)._id
|
: (me as IUser)._id
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
let _post: any;
|
let _post: any;
|
||||||
|
|
||||||
@ -140,7 +140,10 @@ const self = (
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (vote != null) {
|
if (vote != null) {
|
||||||
_post.poll.choices.filter(c => c.id == vote.choice)[0].is_voted = true;
|
const myChoice = _post.poll.choices
|
||||||
|
.filter(c => c.id == vote.choice)[0];
|
||||||
|
|
||||||
|
myChoice.is_voted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user