Skip to content

Commit 7adc850

Browse files
Merge pull request #31 from piyush-jaiswal/feature/cleanup
Feature/cleanup
2 parents a8e4009 + 704bcf7 commit 7adc850

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

app/models.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ class Category(db.Model):
8282
ConstraintFactory.non_empty_string('name'),
8383
)
8484

85-
def to_json(self):
86-
return {
87-
'id': self.id,
88-
'name': self.name,
89-
'created_at': self.created_at,
90-
}
91-
9285

9386
class Subcategory(db.Model):
9487
__tablename__ = 'subcategory'
@@ -102,13 +95,6 @@ class Subcategory(db.Model):
10295
ConstraintFactory.non_empty_string('name'),
10396
)
10497

105-
def to_json(self):
106-
return {
107-
'id': self.id,
108-
'name': self.name,
109-
'created_at': self.created_at,
110-
}
111-
11298

11399
class Product(db.Model):
114100
__tablename__ = 'product'
@@ -121,11 +107,3 @@ class Product(db.Model):
121107
__table_args__ = (
122108
ConstraintFactory.non_empty_string('name'),
123109
)
124-
125-
def to_json(self):
126-
return {
127-
'id': self.id,
128-
'name': self.name,
129-
'description': self.description,
130-
'created_at': self.created_at,
131-
}

app/routes/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
bp = Blueprint("Category", __name__)
2626

2727

28-
@bp.route("")
28+
@bp.route("/")
2929
class CategoryCollection(MethodView):
3030
init_every_request = False
3131

app/routes/product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
bp = Blueprint("Product", __name__)
2525

2626

27-
@bp.route("")
27+
@bp.route("/")
2828
class ProductCollection(MethodView):
2929
init_every_request = False
3030
_PER_PAGE = 10

app/routes/subcategory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
bp = Blueprint("Subcategory", __name__)
2727

2828

29-
@bp.route("")
29+
@bp.route("/")
3030
class SubcategoryCollection(MethodView):
3131
init_every_request = False
3232

0 commit comments

Comments
 (0)