Skip to content

Commit 13a8fb1

Browse files
committed
done
1 parent 6fb85f3 commit 13a8fb1

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/java/org/launchcode/codingevents/controllers/EventCategoryController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.springframework.web.bind.annotation.RequestMapping;
1515

1616
@Controller
17-
@RequestMapping
17+
@RequestMapping("eventCategories")
1818
public class EventCategoryController {
1919

2020
@Autowired
@@ -27,14 +27,14 @@ public String displayAllCategories(Model model) {
2727
return "eventCategories/index";
2828
}
2929

30-
@GetMapping
30+
@GetMapping("create")
3131
public String renderCreateEventCategoryForm (Model model) {
3232
model.addAttribute("title", "Create Category");
3333
model.addAttribute(new EventCategory());
3434
return "eventCategories/create";
3535
}
3636

37-
@PostMapping
37+
@PostMapping("create")
3838
public String processCreateEventForm(@Valid @ModelAttribute EventCategory eventCategory,
3939
Errors errors, Model model) {
4040
if(errors.hasErrors()) {

src/main/resources/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Database connection settings
22
spring.datasource.url=jdbc:mysql://localhost:3306/coding_events
3-
spring.datasource.username=user
4-
spring.datasource.password=password
3+
spring.datasource.username=coding_events
4+
spring.datasource.password=Learn2code!
55

66
# Specify the DBMS
77
spring.jpa.database = MYSQL

src/main/resources/templates/fragments.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ <h1 th:text="${title}">Coding Events</h1>
1515
<li class="nav-item"><a class="nav-link" href="/events">All Events</a></li>
1616
<li class="nav-item"><a class="nav-link" href="/events/create">Create Event</a></li>
1717
<li class="nav-item"><a class="nav-link" href="/events/delete">Delete Events</a></li>
18+
<li class="nav-item"><a class="nav-link" href="/eventCategories">All Categories</a></li>
19+
<li class="nav-item"><a class="nav-link" href="/eventCategories/create">Create Category</a></li>
1820
</ul>
1921
</nav>
2022

0 commit comments

Comments
 (0)