refactor: resolve #7139
This commit is contained in:
@@ -9,7 +9,6 @@ import { Users, Notes, Polls } from '../../../models';
|
||||
import { MoreThan } from 'typeorm';
|
||||
import { Note } from '../../../models/entities/note';
|
||||
import { Poll } from '../../../models/entities/poll';
|
||||
import { ensure } from '../../../prelude/ensure';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-notes');
|
||||
|
||||
@@ -70,7 +69,7 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
|
||||
for (const note of notes) {
|
||||
let poll: Poll | undefined;
|
||||
if (note.hasPoll) {
|
||||
poll = await Polls.findOne({ noteId: note.id }).then(ensure);
|
||||
poll = await Polls.findOneOrFail({ noteId: note.id });
|
||||
}
|
||||
const content = JSON.stringify(serialize(note, poll));
|
||||
await new Promise((res, rej) => {
|
||||
|
Reference in New Issue
Block a user