refactor: Update SkillsPage controller

pull/1/head
Lunix-420 2024-11-08 09:52:30 +01:00
parent 8d780a7385
commit 228bcf2221
2 changed files with 5 additions and 5 deletions

Binary file not shown.

View File

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import com.maradona.backend.entities.SecondarySkill;
import com.maradona.backend.entities.Employee;
import com.maradona.backend.entities.PrimarySkill;
import com.maradona.backend.services.EmployeeService;
import com.maradona.backend.services.SkillService;
@ -80,11 +81,11 @@ public class SkillsPage {
*
* Attributes that can be used by the frontend are a PrimarySkill object
* "primarySkill", a SecondarySkill object "secondarySkill" and a
* SkillForm object "skillForm".
* SkillProtoype object "skillProtoype".
*
* The skillForm object contains the data needed to add a skill to the user
* The skillProtoype object contains the data needed to add a skill to the user
* profile.
* To add it to the user profile, a POST request to /skills/add is needed.
* To add it to a user profile, POST to /api/employee/skill/protoype.
*
* @param model The model with the data to be displayed
* @return The add skill page template
@ -96,8 +97,7 @@ public class SkillsPage {
public String addSkill(Model model) {
// TODO: Make sure it returns the correct initail data for secondary skills
model.addAttribute("primarySkills", primarySkillService.getAllPrimarySkills());
model.addAttribute("secondarySkills", List.of());
model.addAttribute("skillForm", new SkillPrototype());
model.addAttribute("skillProtoype", new SkillPrototype());
return "skills/skills-add";
}