This commit is contained in:
2025-11-25 11:26:33 +03:30
parent d737b3dc24
commit e21abda0ce
7 changed files with 67 additions and 69 deletions
@@ -1,4 +1,4 @@
import { Entity, Property, ManyToMany, Collection } from '@mikro-orm/core';
import { Entity, Property, Collection, OneToMany } from '@mikro-orm/core';
import { Food } from './food.entity';
import { BaseEntity } from '../../../common/entities/base.entity';
@@ -7,7 +7,7 @@ export class Category extends BaseEntity {
@Property()
title!: string;
@ManyToMany(() => Food, food => food.categories)
@OneToMany(() => Food, food => food.category)
foods = new Collection<Food>(this);
@Property({ default: true })