Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Feb 22, 2023
1 parent 72d4ad4 commit 5ec07ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/core/AppLockService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const retryDelay = 100;

@Injectable()
export class AppLockService {
private lock: (key: string, timeout?: number) => Promise<() => void>;
private lock: (key: string, timeout?: number, _?: (() => Promise<void>) | undefined) => Promise<() => void>;

constructor(
@Inject(DI.redis)
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/PushNotificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type PushNotificationsTypes = {
};

// 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;

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export const paramDef = {
properties: {
username: { type: 'string', nullable: true },
},
required: ['username']
required: ['username'],
},
{
properties: {
host: { type: 'string', nullable: true },
},
required: ['host']
required: ['host'],
},
],
} as const;
Expand All @@ -68,15 +68,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => {
const setUsernameAndHostQuery = (query = this.usersRepository.createQueryBuilder('user')) => {
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 === this.config.hostname || ps.host === '.') {
query.andWhere('user.host IS NULL');
} else {
query.andWhere('user.host LIKE :host', {
host: sqlLikeEscape(ps.host.toLowerCase()) + '%'
host: sqlLikeEscape(ps.host.toLowerCase()) + '%',
});
}
}
Expand Down

0 comments on commit 5ec07ed

Please sign in to comment.