add test case
This commit is contained in:
parent
4350232069
commit
e71f08a3de
@ -40,7 +40,7 @@ export class CategoryEntity extends BaseEntity {
|
||||
parent: Relation<CategoryEntity> | null;
|
||||
|
||||
@Type(() => CategoryEntity)
|
||||
@Expose({ groups: ['category-tree'] })
|
||||
@Expose({ groups: ['category-tree', 'category-detail'] })
|
||||
@TreeChildren({ cascade: true })
|
||||
children: Relation<CategoryEntity>[];
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export class CategoryService {
|
||||
}
|
||||
|
||||
async detail(id: string) {
|
||||
return this.repository.findOneOrFail({ where: { id }, relations: ['parent'] });
|
||||
return this.repository.findOneOrFail({ where: { id }, relations: ['parent', 'children'] });
|
||||
}
|
||||
|
||||
async create(data: CreateCategoryDto) {
|
||||
|
Loading…
Reference in New Issue
Block a user