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

fix types

parent 72d4ad4c
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ const retryDelay = 100; ...@@ -12,7 +12,7 @@ const retryDelay = 100;
@Injectable() @Injectable()
export class AppLockService { export class AppLockService {
private lock: (key: string, timeout?: number) => Promise<() => void>; private lock: (key: string, timeout?: number, _?: (() => Promise<void>) | undefined) => Promise<() => void>;
constructor( constructor(
@Inject(DI.redis) @Inject(DI.redis)
......
...@@ -22,7 +22,7 @@ type PushNotificationsTypes = { ...@@ -22,7 +22,7 @@ type PushNotificationsTypes = {
}; };
// Reduce length because push message servers have character limits // Reduce length because push message servers have character limits
function truncateBody<T extends keyof pushNotificationsTypes>(type: T, body: pushNotificationsTypes[T]): pushNotificationsTypes[T] { function truncateBody<T extends keyof PushNotificationsTypes>(type: T, body: PushNotificationsTypes[T]): PushNotificationsTypes[T] {
if (typeof body !== 'object') return body; if (typeof body !== 'object') return body;
return { return {
......
...@@ -37,13 +37,13 @@ export const paramDef = { ...@@ -37,13 +37,13 @@ export const paramDef = {
properties: { properties: {
username: { type: 'string', nullable: true }, username: { type: 'string', nullable: true },
}, },
required: ['username'] required: ['username'],
}, },
{ {
properties: { properties: {
host: { type: 'string', nullable: true }, host: { type: 'string', nullable: true },
}, },
required: ['host'] required: ['host'],
}, },
], ],
} as const; } as const;
...@@ -68,7 +68,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { ...@@ -68,7 +68,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const setUsernameAndHostQuery = (query = this.usersRepository.createQueryBuilder('user')) => { const setUsernameAndHostQuery = (query = this.usersRepository.createQueryBuilder('user')) => {
if (ps.username) { if (ps.username) {
query.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' }) query.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' });
} }
if (ps.host) { if (ps.host) {
...@@ -76,7 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { ...@@ -76,7 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
query.andWhere('user.host IS NULL'); query.andWhere('user.host IS NULL');
} else { } else {
query.andWhere('user.host LIKE :host', { query.andWhere('user.host LIKE :host', {
host: sqlLikeEscape(ps.host.toLowerCase()) + '%' host: sqlLikeEscape(ps.host.toLowerCase()) + '%',
}); });
} }
} }
......
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