catalogue

This commit is contained in:
2026-03-09 12:58:26 +03:30
parent b264500802
commit 4c1d747068
5 changed files with 14 additions and 11 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import { UpdateCatalogueDto } from './dto/update-catalogue.dto';
import { EntityManager } from '@mikro-orm/postgresql';
import { Catalogue } from './entities/catalogue.entity';
import { Business } from '../business/entities/business.entity';
import { CatalogueStatus } from './enums/company-status.enum';
@Injectable()
export class CatalogueService {
@@ -16,7 +17,8 @@ export class CatalogueService {
if (!business) {
throw new BadRequestException()
}
const catalogue = this.em.create(Catalogue, { ...dto, business })
const catalogue = this.em.create(Catalogue,
{ ...dto, business, status: CatalogueStatus.PENDING })
return this.em.persistAndFlush(catalogue)
}