update
This commit is contained in:
@@ -72,7 +72,7 @@ export class BusinessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async findBySlugOrFail(slug: string) {
|
async findBySlugOrFail(slug: string) {
|
||||||
const business = await this.businessRepository.findOne({ slug })
|
const business = await this.businessRepository.findOne({ slug }, { fields: ['id', 'name', 'slug'] })
|
||||||
if (!business) {
|
if (!business) {
|
||||||
throw new NotFoundException("Business not found")
|
throw new NotFoundException("Business not found")
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ export class BusinessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(id: string, dto: UpdateBusinessDto) {
|
async update(id: string, dto: UpdateBusinessDto) {
|
||||||
const business = await this.findByIdOrFail(id)
|
const business = await this.findByIdOrFail(id)
|
||||||
|
|
||||||
if (dto.slug) {
|
if (dto.slug) {
|
||||||
const existing = await this.businessRepository.findOne({ slug: dto.slug, id: { $not: id } })
|
const existing = await this.businessRepository.findOne({ slug: dto.slug, id: { $not: id } })
|
||||||
|
|||||||
@@ -153,11 +153,4 @@ export class DesignRequestService {
|
|||||||
return designRequest;
|
return designRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
update(id: number, updateDesignRequestDto: UpdateDesignRequestDto) {
|
|
||||||
return `This action updates a #${id} designRequest`;
|
|
||||||
}
|
|
||||||
|
|
||||||
remove(id: number) {
|
|
||||||
return `This action removes a #${id} designRequest`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user