From 09c705fe18aac8b9c8d6797990eff13e45d5525e Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 12 Nov 2021 15:08:36 +0900 Subject: [PATCH] refactor --- .../backend/src/queue/processors/db/export-notes.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts index 49850aa70..bd178556d 100644 --- a/packages/backend/src/queue/processors/db/export-notes.ts +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -46,18 +46,18 @@ export async function exportNotes(job: Bull.Job, done: any): Prom }); let exportedNotesCount = 0; - let cursor: any = null; + let cursor: Note['id'] | null = null; while (true) { const notes = await Notes.find({ where: { userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (notes.length === 0) { @@ -115,7 +115,7 @@ export async function exportNotes(job: Bull.Job, done: any): Prom done(); } -function serialize(note: Note, poll: Poll | null = null): any { +function serialize(note: Note, poll: Poll | null = null): Record { return { id: note.id, text: note.text, @@ -128,6 +128,6 @@ function serialize(note: Note, poll: Poll | null = null): any { viaMobile: note.viaMobile, visibility: note.visibility, visibleUserIds: note.visibleUserIds, - localOnly: note.localOnly + localOnly: note.localOnly, }; }