catalogue
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user