wip
This commit is contained in:
parent
5c9df99b07
commit
17289803e8
|
@ -18,7 +18,7 @@ import { isRenote, isQuote } from '@/misc/is-renote.js';
|
||||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
|
|
||||||
export type NoteDraftOptions = MiNoteDraft;
|
export type NoteDraftOptions = Omit<MiNoteDraft, 'id' | 'userId' | 'user' | 'reply' | 'renote' | 'channel'>;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class NoteDraftService {
|
export class NoteDraftService {
|
||||||
|
|
|
@ -198,12 +198,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const draft = await this.noteDraftService.create(me, {
|
const draft = await this.noteDraftService.create(me, {
|
||||||
fileIds: ps.fileIds,
|
fileIds: ps.fileIds,
|
||||||
poll: ps.poll ? {
|
pollChoices: ps.poll?.choices ?? [],
|
||||||
choices: ps.poll.choices,
|
pollMultiple: ps.poll?.multiple ?? false,
|
||||||
multiple: ps.poll.multiple ?? false,
|
pollExpiresAt: ps.poll?.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||||
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
pollExpiredAfter: ps.poll?.expiredAfter ?? null,
|
||||||
expiredAfter: ps.poll.expiredAfter ?? null,
|
hasPoll: ps.poll != null,
|
||||||
} : null,
|
|
||||||
text: ps.text,
|
text: ps.text,
|
||||||
replyId: ps.replyId,
|
replyId: ps.replyId,
|
||||||
renoteId: ps.renoteId,
|
renoteId: ps.renoteId,
|
||||||
|
|
|
@ -230,12 +230,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const draft = await this.noteDraftService.update(me, ps.draftId, {
|
const draft = await this.noteDraftService.update(me, ps.draftId, {
|
||||||
fileIds: ps.fileIds,
|
fileIds: ps.fileIds,
|
||||||
poll: ps.poll ? {
|
pollChoices: ps.poll?.choices,
|
||||||
choices: ps.poll.choices,
|
pollMultiple: ps.poll?.multiple,
|
||||||
multiple: ps.poll.multiple ?? false,
|
pollExpiresAt: ps.poll?.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||||
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
pollExpiredAfter: ps.poll?.expiredAfter,
|
||||||
expiredAfter: ps.poll.expiredAfter ?? null,
|
|
||||||
} : undefined,
|
|
||||||
text: ps.text,
|
text: ps.text,
|
||||||
replyId: ps.replyId,
|
replyId: ps.replyId,
|
||||||
renoteId: ps.renoteId,
|
renoteId: ps.renoteId,
|
||||||
|
|
Loading…
Reference in New Issue