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

GuildSavedMessages: only return non-deleted messages with find

This commit is contained in:
Dragory 2018-11-24 14:33:43 +02:00
parent 68fa25fbc4
commit 2f341d97d8

View file

@ -62,12 +62,12 @@ export class GuildSavedMessages extends BaseRepository {
}
find(id) {
return this.messages.findOne({
where: {
guild_id: this.guildId,
id
}
});
return this.messages
.createQueryBuilder()
.where("guild_id = :guild_id", { guild_id: this.guildId })
.andWhere("id = :id", { id })
.andWhere("deleted_at IS NULL")
.getOne();
}
async create(data) {