feat(pets): adds register view and validations wip

This commit is contained in:
2024-12-08 23:07:45 -03:00
parent ff9d94bb72
commit a41a929ca5
8 changed files with 309 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
from flask import request, render_template
from app.pets import bp
from app.services.pet_service import PetService
from app.utils.helpers import login_required
@bp.route('/')
def index():
@@ -8,4 +9,11 @@ def index():
"pets/index.html",
options=PetService.get_options(request),
pagination_result=PetService.get_pets(request)
)
)
@bp.route('register', methods=["GET", "POST"])
def register():
if request.method == 'POST':
PetService.register_pet(request)
types = PetService.get_pets_kind()
return render_template("pets/register.html", types=types)