fix(backend): type

This commit is contained in:
Acid Chicken (硫酸鶏) 2024-05-29 17:23:00 +09:00
parent 024d854cf4
commit 7e967f36ba
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
1 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ import { dateUTC, isTimeSame, isTimeBefore, subtractTime, addTime } from '@/misc
import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js';
import { MiRepository, miRepository } from '@/models/_.js';
import type { DataSource } from 'typeorm';
import type { DataSource, Repository } from 'typeorm';
const COLUMN_PREFIX = '___' as const;
const UNIQUE_TEMP_COLUMN_PREFIX = 'unique_temp___' as const;
@ -146,10 +146,10 @@ export default abstract class Chart<T extends Schema> {
group: string | null;
}[] = [];
// ↓にしたいけどfindOneとかで型エラーになる
//private repositoryForHour: MiRepository<RawRecord<T>>;
//private repositoryForDay: MiRepository<RawRecord<T>>;
private repositoryForHour: MiRepository<{ id: number; group?: string | null; date: number; }>;
private repositoryForDay: MiRepository<{ id: number; group?: string | null; date: number; }>;
//private repositoryForHour: Repository<RawRecord<T>> & MiRepository<RawRecord<T>>;
//private repositoryForDay: Repository<RawRecord<T>> & MiRepository<RawRecord<T>>;
private repositoryForHour: Repository<{ id: number; group?: string | null; date: number; }> & MiRepository<{ id: number; group?: string | null; date: number; }>;
private repositoryForDay: Repository<{ id: number; group?: string | null; date: number; }> & MiRepository<{ id: number; group?: string | null; date: number; }>;
/**
* 1(CASCADE削除などアプリケーション側で感知できない変動によるズレの修正用)