Skip to content

Commit

Permalink
Fix : change BadRequest to NotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
rlawnaks committed Sep 8, 2023
1 parent eaaa63e commit f622aeb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/phone/service/phone.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ** Nest Imports
import { Injectable } from '@nestjs/common';
import { Injectable, NotFoundException } from '@nestjs/common';
import PhoneRepository from '../repository/phone.repository';

// ** enum, dto, entity, types Imports
Expand Down Expand Up @@ -44,7 +44,7 @@ export default class PhoneService {
});

if (!findPhone) {
throw new BadRequestException('NOT Exist Phone Number');
throw new NotFoundException('Phone NOT Found');
}

return CommonResponse.of({
Expand Down Expand Up @@ -76,7 +76,7 @@ export default class PhoneService {
});

if (!findPhone) {
throw new BadRequestException('NOT Exist Phone Number');
throw new NotFoundException('Phone NOT Found');
}

findPhone.name = dto.name
Expand All @@ -100,7 +100,7 @@ export default class PhoneService {
});

if (!findPhone) {
throw new BadRequestException('NOT Exist Phone Number');
throw new NotFoundException('Phone NOT Found');
}

this.phoneRepository.delete(id)
Expand Down

0 comments on commit f622aeb

Please sign in to comment.