Skip to content

Commit c12644d

Browse files
committed
Fix build errors from merge
1 parent efd213d commit c12644d

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/commands/ignore.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ export default class Ignore extends Command {
1414

1515
public override async execute(interaction: CommandInteraction) {
1616
if (!interaction.guildId) return;
17-
17+
1818
const isChannelIgnored = await IgnoredChannel.IsChannelIgnored(interaction.guildId);
19-
19+
2020
if (isChannelIgnored) {
2121
const entity = await IgnoredChannel.FetchOneById(IgnoredChannel, interaction.guildId);
22-
22+
23+
if (!entity) {
24+
await interaction.reply('Unable to find channel.');
25+
return;
26+
}
27+
2328
await IgnoredChannel.Remove(IgnoredChannel, entity);
2429

2530
await interaction.reply('This channel will start being logged again.');

src/entity/Audit.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ export default class Audit extends BaseEntity {
3434
@Column()
3535
ServerId: string;
3636

37-
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | undefined> {
37+
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | null> {
3838
const connection = getConnection();
3939

4040
const repository = connection.getRepository(Audit);
4141

42-
const all = await repository.find({ UserId: userId, ServerId: serverId });
42+
const all = await repository.find({ where: { UserId: userId, ServerId: serverId } });
4343

4444
return all;
4545
}
4646

47-
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | undefined> {
47+
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | null> {
4848
const connection = getConnection();
4949

5050
const repository = connection.getRepository(Audit);
5151

52-
const single = await repository.findOne({ AuditId: auditId, ServerId: serverId });
52+
const single = await repository.findOne({ where: { AuditId: auditId, ServerId: serverId } });
5353

5454
return single;
5555
}

src/entity/IgnoredChannel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class IgnoredChannel extends BaseEntity {
1414

1515
const repository = connection.getRepository(IgnoredChannel);
1616

17-
const single = await repository.findOne(channelId);
17+
const single = await repository.findOne({ where: { Id: channelId } });
1818

1919
return single != undefined;
2020
}

0 commit comments

Comments
 (0)