wip
This commit is contained in:
parent
2ab2081caa
commit
914eb0bd35
|
@ -357,8 +357,6 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
if (ps.poll.expiresAt < Date.now()) {
|
||||
throw new IdentifiableError('0c11c11e-0c8d-48e7-822c-76ccef660068', 'Poll expiration must be future time');
|
||||
}
|
||||
} else if (typeof ps.poll.expiredAfter === 'number') {
|
||||
ps.poll.expiresAt = Date.now() + ps.poll.expiredAfter;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ export class PostScheduledNoteProcessorService {
|
|||
const note = await this.noteCreateService.fetchAndCreate(draft.user, {
|
||||
createdAt: new Date(),
|
||||
fileIds: draft.fileIds,
|
||||
poll: ps.poll ? {
|
||||
choices: ps.poll.choices,
|
||||
multiple: ps.poll.multiple ?? false,
|
||||
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||
} : undefined,
|
||||
poll: draft.hasPoll ? {
|
||||
choices: draft.pollChoices,
|
||||
multiple: draft.pollMultiple,
|
||||
expiresAt: draft.pollExpiredAfter ? new Date(Date.now() + draft.pollExpiredAfter) : draft.pollExpiresAt ? new Date(draft.pollExpiresAt) : null,
|
||||
} : null,
|
||||
text: draft.text ?? null,
|
||||
replyId: draft.replyId,
|
||||
renoteId: draft.renoteId,
|
||||
|
|
|
@ -227,8 +227,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
poll: ps.poll ? {
|
||||
choices: ps.poll.choices,
|
||||
multiple: ps.poll.multiple ?? false,
|
||||
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||
} : undefined,
|
||||
expiresAt: ps.poll.expiredAfter ? new Date(Date.now() + ps.poll.expiredAfter) : ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||
} : null,
|
||||
text: ps.text ?? null,
|
||||
replyId: ps.replyId ?? null,
|
||||
renoteId: ps.renoteId ?? null,
|
||||
|
|
Loading…
Reference in New Issue