feat: add get warranty detail
This commit is contained in:
@@ -61,6 +61,15 @@ class WarrantyService {
|
||||
async getPendingWarranties() {
|
||||
return await this.warrantyRepo.pendingWarranties();
|
||||
}
|
||||
|
||||
async getWarranty(id: number) {
|
||||
const warranty = await this.warrantyRepo.model.findById(id);
|
||||
if (!warranty) throw new BadRequestError(CommonMessage.NotValidId);
|
||||
|
||||
return {
|
||||
warranty,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export { WarrantyService };
|
||||
|
||||
Reference in New Issue
Block a user