Changeset 8b875e6 for src/main/java/mk/ukim/finki/busngo/web
- Timestamp:
- 05/05/24 01:27:16 (7 months ago)
- Branches:
- master
- Children:
- baf4cc4
- Parents:
- 4d026a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/mk/ukim/finki/busngo/web/RegisterController.java
r4d026a5 r8b875e6 2 2 3 3 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 import mk.ukim.finki.busngo.model.enums.Role; 4 5 import mk.ukim.finki.busngo.model.enums.VrabotenType; 5 6 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException; … … 35 36 } 36 37 37 model.addAttribute(" types", VrabotenType.values());38 model.addAttribute("roles", Role.values()); 38 39 39 40 model.addAttribute("bodyContent", "register"); … … 48 49 @RequestParam String address, 49 50 @RequestParam String phone, 50 @RequestParam (required = false)VrabotenType vrabotenType,51 @RequestParam Role role, 51 52 @RequestParam(required = false) Double salary 52 53 ) { 53 54 try{ 54 Korisnik korisnik; 55 if(vrabotenType != null){ 56 korisnik = this.authService.registerVraboten(name, email, password, confirmPassword, address, phone, vrabotenType, salary); 55 Korisnik korisnik = authService.register(name, email, password, confirmPassword, address, phone, role, salary); 57 56 58 }59 else60 korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone);61 57 return "redirect:/login"; 62 58 } catch (InvalidCredentialsException | UserAlreadyExistsException exception) {
Note:
See TracChangeset
for help on using the changeset viewer.