Merge branch 'fix/scheduled-post-file' into 'develop'

fix: Scheduled post cannot send post with attachments

Co-authored-by: Lhcfl <Lhcfl@outlook.com>

See merge request firefish/firefish!10890
This commit is contained in:
naskya 2024-05-22 08:21:01 +00:00
commit c6badcc11d
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,4 @@
import { Users, Notes, ScheduledNotes } from "@/models/index.js";
import { Users, Notes, ScheduledNotes, DriveFiles } from "@/models/index.js";
import type { DbUserScheduledNoteData } from "@/queue/types.js";
import { queueLogger } from "../../logger.js";
import type Bull from "bull";
@ -25,6 +25,7 @@ export async function scheduledNote(
done();
return;
}
const files = await DriveFiles.findBy({ id: In(note.fileIds) });
if (user.isSuspended) {
deleteNote(user, note);
@ -45,7 +46,7 @@ export async function scheduledNote(
await createNote(user, {
createdAt: new Date(),
files: note.files,
files,
poll: job.data.option.poll,
text: note.text || undefined,
lang: note.lang,

View file

@ -13,7 +13,7 @@
<i
v-else-if="note.visibility === 'specified' && note.scheduledAt"
ref="specified"
v-tooltip="i18n.t('scheduledPostAt', { time: note.scheduledAt })"
v-tooltip="new Date(note.scheduledAt).toLocaleString()"
:class="icon('ph-clock')"
></i>
<i