3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 15:45:03 +00:00

Add safety net for attempts to create a duplicate case for a single kick audit log entry

This commit is contained in:
Dragory 2019-04-14 17:05:07 +03:00
parent 268d88e4c5
commit 4e0bd46e0d
2 changed files with 27 additions and 8 deletions

View file

@ -77,6 +77,16 @@ export class GuildCases extends BaseRepository {
});
}
async findByAuditLogId(auditLogId: string): Promise<Case> {
return this.cases.findOne({
relations: this.getRelations(),
where: {
guild_id: this.guildId,
audit_log_id: auditLogId,
},
});
}
async getByUserId(userId: string): Promise<Case[]> {
return this.cases.find({
relations: this.getRelations(),