(enhance) notes/create で予約投稿できるように

This commit is contained in:
kakkokari-gtyih 2023-11-09 23:31:16 +09:00
parent 1995400dac
commit 2bc15c09ed
9 changed files with 122 additions and 23 deletions

View file

@ -40,7 +40,9 @@ const props = defineProps<{
}>();
async function deleteScheduleNote() {
await os.apiWithDialog('notes/schedule/delete', { noteId: props.note.id })
if (!props.note.isSchedule) return;
// ID稿ID(scheduledNoteId)
await os.apiWithDialog('notes/schedule/delete', { scheduledNoteId: props.note.id })
.then(() => {
isDeleted.value = true;
});

View file

@ -751,7 +751,7 @@ async function post(ev?: MouseEvent) {
renoteId: props.renote ? props.renote.id : quoteId ? quoteId : undefined,
channelId: props.channel ? props.channel.id : undefined,
schedule,
poll: poll,
poll,
cw: useCw ? cw ?? '' : null,
localOnly: localOnly,
visibility: visibility,
@ -783,11 +783,11 @@ async function post(ev?: MouseEvent) {
if (postAccount) {
const storedAccounts = await getAccounts();
token = storedAccounts.find(x => x.id === postAccount.id)?.token;
token = storedAccounts.find(x => x.id === postAccount?.id)?.token;
}
posting = true;
os.api(postData.schedule ? 'notes/schedule/create' : 'notes/create', postData, token).then(() => {
os.api('notes/create', postData, token).then(() => {
if (props.freezeAfterPosted) {
posted = true;
} else {