refacator: fix typw

This commit is contained in:
syuilo 2022-02-19 14:53:33 +09:00
parent 1dc06f7ad3
commit b6db709e02
7 changed files with 7 additions and 8 deletions

View file

@ -31,7 +31,7 @@ export async function deleteAccount(job: Bull.Job<DbUserDeleteJobData>): Promise
order: {
id: 1,
},
});
}) as Note[];
if (notes.length === 0) {
break;
@ -58,7 +58,7 @@ export async function deleteAccount(job: Bull.Job<DbUserDeleteJobData>): Promise
order: {
id: 1,
},
});
}) as DriveFile[];
if (files.length === 0) {
break;

View file

@ -75,7 +75,7 @@ export async function exportCustomEmojis(job: Bull.Job, done: () => void): Promi
await downloadUrl(emoji.originalUrl, emojiPath);
downloaded = true;
} catch (e) { // TODO: 何度か再試行
logger.error(e);
logger.error(e instanceof Error ? e : new Error(e as string));
}
if (!downloaded) {

View file

@ -51,7 +51,7 @@ export async function exportFollowing(job: Bull.Job<DbUserJobData>, done: () =>
order: {
id: 1,
},
});
}) as Following[];
if (followings.length === 0) {
break;

View file

@ -62,7 +62,7 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, done: any): Prom
order: {
id: 1,
},
});
}) as Note[];
if (notes.length === 0) {
job.progress(100);

View file

@ -199,7 +199,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
throw new Error('already registered');
}
} else {
logger.error(e);
logger.error(e instanceof Error ? e : new Error(e as string));
throw e;
}
}

View file

@ -48,7 +48,6 @@ export default define(meta, paramDef, async (ps, user) => {
await PromoNotes.insert({
noteId: note.id,
createdAt: new Date(),
expiresAt: new Date(ps.expiresAt),
userId: note.userId,
});

View file

@ -13,7 +13,7 @@ import renderCreate from '@/remote/activitypub/renderer/create';
import { renderActivity } from '@/remote/activitypub/renderer/index';
import { deliver } from '@/queue/index';
export async function createMessage(user: { id: User['id']; host: User['host']; }, recipientUser: User | undefined, recipientGroup: UserGroup | undefined, text: string | undefined, file: DriveFile | null, uri?: string) {
export async function createMessage(user: { id: User['id']; host: User['host']; }, recipientUser: User | undefined, recipientGroup: UserGroup | undefined, text: string | null | undefined, file: DriveFile | null, uri?: string) {
const message = {
id: genId(),
createdAt: new Date(),