refactor: fix types

This commit is contained in:
syuilo 2023-02-09 11:02:37 +09:00
parent e1e885d6b2
commit 5facd11592
5 changed files with 9 additions and 4 deletions

View file

@ -1,10 +1,10 @@
import { Inject, Injectable } from '@nestjs/common';
import { Brackets } from 'typeorm';
import { Brackets, ObjectLiteral } from 'typeorm';
import { DI } from '@/di-symbols.js';
import type { User } from '@/models/entities/User.js';
import type { UserProfilesRepository, FollowingsRepository, ChannelFollowingsRepository, MutedNotesRepository, BlockingsRepository, NoteThreadMutingsRepository, MutingsRepository } from '@/models/index.js';
import type { SelectQueryBuilder } from 'typeorm';
import { bindThis } from '@/decorators.js';
import type { SelectQueryBuilder } from 'typeorm';
@Injectable()
export class QueryService {
@ -32,7 +32,7 @@ export class QueryService {
) {
}
public makePaginationQuery<T>(q: SelectQueryBuilder<T>, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder<T> {
public makePaginationQuery<T extends ObjectLiteral>(q: SelectQueryBuilder<T>, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder<T> {
if (sinceId && untilId) {
q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId });
q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId });

View file

@ -51,7 +51,7 @@ export function genIdenticon(seed: string, stream: WriteStream): Promise<void> {
bg.addColorStop(0, bgColors[0]);
bg.addColorStop(1, bgColors[1]);
ctx.fillStyle = bg;
ctx.fillStyle = bg as any;
ctx.beginPath();
ctx.fillRect(0, 0, size, size);

View file

@ -540,6 +540,7 @@ export class ActivityPubServerService {
return (this.apRendererService.renderActivity(this.apRendererService.renderKey(user, keypair)));
} else {
reply.code(400);
return;
}
});

View file

@ -146,6 +146,7 @@ export class SignupApiService {
`To complete signup, please click this link: ${link}`);
reply.code(204);
return;
} else {
try {
const { account, secret } = await this.signupService.signup({

View file

@ -372,6 +372,7 @@ export class ClientServerService {
return feed.atom1();
} else {
reply.code(404);
return;
}
});
@ -384,6 +385,7 @@ export class ClientServerService {
return feed.rss2();
} else {
reply.code(404);
return;
}
});
@ -396,6 +398,7 @@ export class ClientServerService {
return feed.json1();
} else {
reply.code(404);
return;
}
});