Fix build errors from merge
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ethan Lane 2023-05-08 18:37:51 +01:00
parent efd213d085
commit c12644d537
3 changed files with 13 additions and 8 deletions

View file

@ -20,6 +20,11 @@ export default class Ignore extends Command {
if (isChannelIgnored) {
const entity = await IgnoredChannel.FetchOneById(IgnoredChannel, interaction.guildId);
if (!entity) {
await interaction.reply('Unable to find channel.');
return;
}
await IgnoredChannel.Remove(IgnoredChannel, entity);
await interaction.reply('This channel will start being logged again.');

View file

@ -34,22 +34,22 @@ export default class Audit extends BaseEntity {
@Column()
ServerId: string;
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | undefined> {
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | null> {
const connection = getConnection();
const repository = connection.getRepository(Audit);
const all = await repository.find({ UserId: userId, ServerId: serverId });
const all = await repository.find({ where: { UserId: userId, ServerId: serverId } });
return all;
}
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | undefined> {
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | null> {
const connection = getConnection();
const repository = connection.getRepository(Audit);
const single = await repository.findOne({ AuditId: auditId, ServerId: serverId });
const single = await repository.findOne({ where: { AuditId: auditId, ServerId: serverId } });
return single;
}

View file

@ -14,7 +14,7 @@ export default class IgnoredChannel extends BaseEntity {
const repository = connection.getRepository(IgnoredChannel);
const single = await repository.findOne(channelId);
const single = await repository.findOne({ where: { Id: channelId } });
return single != undefined;
}