order foods and categories

This commit is contained in:
2026-01-07 19:12:11 +03:30
parent 9a182d8b7b
commit c58a77cb53
2 changed files with 3 additions and 2 deletions
@@ -24,7 +24,7 @@ export class FoodRepository extends EntityRepository<Food> {
* Supports: search (title/content), categoryId, isActive, ordering.
*/
async findAllPaginated(restId: string, opts: FindFoodsOpts = {}): Promise<PaginatedResult<Food>> {
const { page = 1, limit = 10, search, orderBy = 'createdAt', order = 'desc', categoryId, isActive } = opts;
const { page = 1, limit = 10, search, orderBy = 'order', order = 'ASC', categoryId, isActive } = opts;
const offset = (page - 1) * limit;