sort เรียงจากวันที่สร้าง

This commit is contained in:
Bright 2024-11-27 13:43:01 +07:00
parent 786da60910
commit 483e64ffe3

View file

@ -54,32 +54,8 @@ export class PortfolioController extends Controller {
"createdFullName",
"lastUpdateFullName",
],
order: { name: "ASC" },
order: { createdAt: "DESC" },
});
// const _portfolio = await this.portfolioRepository
// .createQueryBuilder("portfolio")
// .select([
// "portfolio.id",
// "portfolio.name",
// "portfolio.detail",
// "portfolio.createdAt",
// "portfolio.lastUpdatedAt",
// "portfolio.createdFullName",
// "portfolio.lastUpdateFullName",
// ])
// .where("portfolio.createdUserId = :userId", { userId: request.user.sub })
// .andWhere(
// new Brackets((qb) => {
// qb.where(keyword != null && keyword != "" ? "portfolio.name LIKE :keyword" : "1=1", {
// keyword: `%${keyword}%`,
// }).orWhere(keyword != null && keyword != "" ? "portfolio.detail LIKE :keyword" : "1=1", {
// keyword: `%${keyword}%`,
// });
// }),
// )
// .getMany();
return new HttpSuccess(_portfolio);
}