Create embed helper function
This commit is contained in:
parent
9fce79579b
commit
96bbd3b28a
1 changed files with 8 additions and 7 deletions
|
@ -63,13 +63,14 @@ export default class UserEffect extends AppBaseEntity {
|
||||||
|
|
||||||
const repository = AppDataSource.getRepository(UserEffect);
|
const repository = AppDataSource.getRepository(UserEffect);
|
||||||
|
|
||||||
const all = await repository.find({
|
const query = await repository.createQueryBuilder("effect")
|
||||||
where: { UserId: userId },
|
.where("effect.UserId = :userId", { userId })
|
||||||
order: { Name: "ASC" },
|
.where("effect.Unused > 0")
|
||||||
skip: page * itemsPerPage,
|
.orderBy("effect.Name", "ASC")
|
||||||
take: itemsPerPage,
|
.skip(page * itemsPerPage)
|
||||||
});
|
.take(itemsPerPage)
|
||||||
|
.getMany();
|
||||||
|
|
||||||
return all;
|
return query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue