fix for lint
This commit is contained in:
parent
01afdc410e
commit
8b7f5be878
12 changed files with 581 additions and 574 deletions
|
|
@ -244,8 +244,9 @@ export default define(meta, async (ps, user) => {
|
|||
|
||||
if (ps.poll) {
|
||||
if (typeof ps.poll.expiresAt === 'number') {
|
||||
if (ps.poll.expiresAt < Date.now())
|
||||
if (ps.poll.expiresAt < Date.now()) {
|
||||
throw new ApiError(meta.errors.cannotCreateAlreadyExpiredPoll);
|
||||
}
|
||||
} else if (typeof ps.poll.expiredAfter === 'number') {
|
||||
ps.poll.expiresAt = Date.now() + ps.poll.expiredAfter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,9 @@ export default define(meta, async (ps, user) => {
|
|||
|
||||
if (exist.length) {
|
||||
if (poll.multiple) {
|
||||
if (exist.some(x => x.choice == ps.choice))
|
||||
if (exist.some(x => x.choice == ps.choice)) {
|
||||
throw new ApiError(meta.errors.alreadyVoted);
|
||||
}
|
||||
} else {
|
||||
throw new ApiError(meta.errors.alreadyVoted);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue