Changeset aced08c


Ignore:
Timestamp:
02/16/23 14:41:19 (21 months ago)
Author:
trajchevaM <118018439+trajchevaM@…>
Branches:
main
Children:
eef07ff
Parents:
dad5bcd
Message:

Updated RegisterController and Adopter

Changed primitive types of Adopter

Location:
Prototype Application/Paw5/src/main/java/finki/paw5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Adopter.java

    rdad5bcd raced08c  
    2323
    2424    @Column(name = "has_other_pets")
    25     private boolean hasOtherPets;
     25    private Boolean hasOtherPets;
    2626
    2727    @Column(name = "has_kids")
    28     private boolean hasKids;
     28    private Boolean hasKids;
    2929
    3030    @Column(name = "housing")
     
    3535
    3636    @Column(name = "will_foster")
    37     private boolean willFoster;
     37    private Boolean willFoster;
    3838
    3939    @Column(name = "is_verified", nullable = false)
    40     private boolean verified;
     40    private Boolean verified;
    4141
    4242    @Column(name = "verified_by_employee")
  • Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/RegisterController.java

    rdad5bcd raced08c  
    4242                               @RequestParam String password, @RequestParam String repeatPassword,
    4343                               @RequestParam String telephone,@RequestParam String role,
    44                                HttpServletRequest request) {
     44                               @RequestParam (required = false) String freeTime,  @RequestParam (required = false) String funds,
     45                               @RequestParam (required = false) boolean hasOtherPets, @RequestParam (required = false) boolean hasKids,
     46                               @RequestParam (required = false) String housing, @RequestParam (required = false) String physicalActivity,
     47                               @RequestParam (required = false) boolean willFoster, @RequestParam (required = false) Integer shelter,
     48                               @RequestParam (required = false)  String position, HttpServletRequest request) {
    4549
    4650        if(role.equals("adopter") & password.equals(repeatPassword)){
    47             String freeTime = request.getParameter("freeTime");
    48             String funds = request.getParameter("funds");
    49             boolean hasOtherPets = Boolean.parseBoolean(request.getParameter("hasOtherPets"));
    50             boolean hasKids = Boolean.parseBoolean(request.getParameter("hasKids"));
    51             String housing = request.getParameter("housing");
    52             String physicalActivity = request.getParameter("physicalActivity");
    53             boolean willFoster = Boolean.parseBoolean(request.getParameter("willFoster"));
    5451
    5552            FreeTime ft = FreeTime.valueOf(freeTime);
     
    6461        }
    6562        else if(role.equals("employee") & password.equals(repeatPassword)){
    66             Integer shelter = Integer.valueOf(request.getParameter("shelter"));
    67             String position = request.getParameter("position");
    6863
    6964            Employee employeeUser = authService.registerEmployee(name, email, password, telephone,position,shelter);
Note: See TracChangeset for help on using the changeset viewer.