Add friendly name and active effect to user effect list embed #422

Merged
Vylpes merged 5 commits from feature/379-2 into develop 2025-02-03 18:24:27 +00:00
Showing only changes of commit 7c17e1d0d0 - Show all commits

View file

@ -63,7 +63,7 @@ export default class UserEffect extends AppBaseEntity {
const query = await repository.createQueryBuilder("effect") const query = await repository.createQueryBuilder("effect")
.where("effect.UserId = :userId", { userId }) .where("effect.UserId = :userId", { userId })
.where("effect.Unused > 0") .andWhere("effect.Unused > 0")
.orderBy("effect.Name", "ASC") .orderBy("effect.Name", "ASC")
.skip(page * itemsPerPage) .skip(page * itemsPerPage)
.take(itemsPerPage) .take(itemsPerPage)
@ -77,8 +77,8 @@ export default class UserEffect extends AppBaseEntity {
const query = await repository.createQueryBuilder("effect") const query = await repository.createQueryBuilder("effect")
.where("effect.UserId = :userId", { userId }) .where("effect.UserId = :userId", { userId })
.where("effect.WhenExpires IS NOT NULL") .andWhere("effect.WhenExpires IS NOT NULL")
Vylpes marked this conversation as resolved Outdated

Incorrect use of where clause. The second where should be andWhere to ensure the query is constructed correctly.

            .andWhere("effect.WhenExpires IS NOT NULL")
Incorrect use of `where` clause. The second `where` should be `andWhere` to ensure the query is constructed correctly. ```suggestion .andWhere("effect.WhenExpires IS NOT NULL") ```
.andWhere("effect.WhenExpires > :now", { now: new Date() }) .andWhere("effect.WhenExpires > :now", { now: new Date() })
.getOne(); .getOne();
return query; return query;