feat: upgrade to TypeORM 0.3
This commit is contained in:
parent
8cee4ec1e4
commit
761ff27771
57 changed files with 412 additions and 325 deletions
|
@ -1,6 +1,7 @@
|
|||
import moment from "moment-timezone";
|
||||
import { getRepository, Repository } from "typeorm";
|
||||
import { Repository } from "typeorm";
|
||||
import { BaseGuildRepository } from "./BaseGuildRepository";
|
||||
import { dataSource } from "./dataSource";
|
||||
import { Tempban } from "./entities/Tempban";
|
||||
|
||||
export class GuildTempbans extends BaseGuildRepository {
|
||||
|
@ -8,7 +9,7 @@ export class GuildTempbans extends BaseGuildRepository {
|
|||
|
||||
constructor(guildId) {
|
||||
super(guildId);
|
||||
this.tempbans = getRepository(Tempban);
|
||||
this.tempbans = dataSource.getRepository(Tempban);
|
||||
}
|
||||
|
||||
async getExpiredTempbans(): Promise<Tempban[]> {
|
||||
|
@ -20,7 +21,7 @@ export class GuildTempbans extends BaseGuildRepository {
|
|||
.getMany();
|
||||
}
|
||||
|
||||
async findExistingTempbanForUserId(userId: string): Promise<Tempban | undefined> {
|
||||
async findExistingTempbanForUserId(userId: string): Promise<Tempban | null> {
|
||||
return this.tempbans.findOne({
|
||||
where: {
|
||||
guild_id: this.guildId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue