Skip to content
Snippets Groups Projects
Commit b404ce46 authored by syuilo's avatar syuilo
Browse files

refactor

parent 4786214e
No related branches found
No related tags found
No related merge requests found
......@@ -46,18 +46,18 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, 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<DbUserJobData>, done: any): Prom
done();
}
function serialize(note: Note, poll: Poll | null = null): any {
function serialize(note: Note, poll: Poll | null = null): Record<string, unknown> {
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,
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment