refactor food
This commit is contained in:
@@ -40,8 +40,8 @@ export class FoodRepository extends EntityRepository<Food> {
|
||||
}
|
||||
|
||||
if (categoryId) {
|
||||
// filter by related categories (typed via FilterQuery)
|
||||
Object.assign(where, { categories: { id: categoryId } } as unknown as FilterQuery<Food>);
|
||||
// filter by related category (Food has a single `category` relation)
|
||||
Object.assign(where, { category: { id: categoryId } } as unknown as FilterQuery<Food>);
|
||||
}
|
||||
|
||||
const [data, total] = await this.findAndCount(where, {
|
||||
|
||||
Reference in New Issue
Block a user