feat: add filter on endpoint product all

This commit is contained in:
caturbgs
2021-12-22 13:35:59 +07:00
parent d8b9202fb7
commit ad81712bfa
3 changed files with 51 additions and 25 deletions

View File

@@ -199,4 +199,24 @@ export class SupplierService {
}
}
}
async findByActiveAll() {
try {
return await this.supplierRepository.find({
status: true,
});
} catch (e) {
if (e instanceof EntityNotFoundError) {
throw new HttpException(
{
statusCode: HttpStatus.NOT_FOUND,
error: 'Supplier Data not found',
},
HttpStatus.NOT_FOUND,
);
} else {
throw e;
}
}
}
}