up
This commit is contained in:
@@ -15,12 +15,12 @@ export class CategoryService {
|
||||
) {}
|
||||
|
||||
async create(dto: CreateCategoryDto): Promise<Category> {
|
||||
const data = {
|
||||
const data: RequiredEntityData<Category> = {
|
||||
title: dto.title,
|
||||
isActive: dto.isActive ?? true,
|
||||
restId: dto.restId,
|
||||
avatarUrl: dto.avatarUrl,
|
||||
} as RequiredEntityData<Category>;
|
||||
};
|
||||
|
||||
const category = this.categoryRepository.create(data);
|
||||
await this.em.persistAndFlush(category);
|
||||
|
||||
Reference in New Issue
Block a user