idの混同を修正

This commit is contained in:
kakkokari-gtyih 2023-11-23 17:20:37 +09:00
parent a2ea072deb
commit 6c3d6ba955
5 changed files with 24 additions and 56 deletions

View file

@ -36,13 +36,23 @@ import MkButton from '@/components/MkButton.vue';
import * as os from '@/os.js';
const isDeleted = ref(false);
const props = defineProps<{
note: Misskey.entities.Note & {isSchedule? : boolean};
note: Misskey.entities.Note & {
id: string | null;
isSchedule?: boolean;
scheduledNoteId?: string;
};
}>();
async function deleteScheduleNote() {
if (!props.note.isSchedule) return;
// ID稿ID(scheduledNoteId)
await os.apiWithDialog('notes/schedule/delete', { scheduledNoteId: props.note.id })
if (!props.note.isSchedule || !props.note.scheduledNoteId) return;
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.ts._schedulePost.deleteAreYouSure,
});
if (canceled) return;
await os.apiWithDialog('notes/schedule/delete', { scheduledNoteId: props.note.scheduledNoteId })
.then(() => {
isDeleted.value = true;
});