fix data
This commit is contained in:
@@ -64,6 +64,15 @@ class Products(db.Model):
|
||||
raise ValueError(f"No available Products")
|
||||
return product_list
|
||||
|
||||
@classmethod
|
||||
def get_product_by_product_id(cls, product_id):
|
||||
"""
|
||||
Get customer's active loans by loan_id.
|
||||
"""
|
||||
productItem = cls.query.filter_by(product_id = product_id).first()
|
||||
if not productItem:
|
||||
raise ValueError(f"pProduct with ID {product_id} does not exist.")
|
||||
return productItem
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user