Skip to content

Commit

Permalink
#267 Update to @DeleteMapping annotation for delete record by ID API …
Browse files Browse the repository at this point in the history
…call
  • Loading branch information
conorheffron committed Oct 15, 2024
1 parent efbe95b commit c05a11d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/resources/application-h2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.id.new_generator_mappings=false

google.cloud.db.secret.version=projects/902038140834/secrets/MY_SQL_PASSWORD/versions/1

spring.mvc.hiddenmethod.filter.enabled=true
11 changes: 9 additions & 2 deletions src/main/resources/templates/employee-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ <h3>Employees</h3>
<td th:text="${person.firstName}"></td>
<td th:text="${person.surname}"></td>
<td th:text="${person.age}"></td>
<td><a th:href="@{/edit/{id}(id=${person.id})}" class="btn btn-primary btn-sm rounded-0" type="button"><i class="fa fa-edit"></i></a></td>
<td><a th:href="@{/delete/{id}(id=${person.id})}" class="btn btn-primary btn-sm rounded-0" type="button"><i class="fa fa-trash"></i></a></td>
<td><a th:href="@{/edit/{id}(id=${person.id})}" class="btn btn-primary btn-sm rounded-0" type="button">
<i class="fa fa-edit"></i></a>
</td>
<td>
<form action="#" th:action="@{/delete/{id}(id=${person.id})}" th:method="delete" >
<input type="hidden" name="_method" value="delete" />
<button type="submit" class="btn btn-primary btn-sm rounded-0"><i class="fa fa-trash"></i></a></button>
</form>
</td>
</tr>
<tr>
<td colspan="3" />
Expand Down

0 comments on commit c05a11d

Please sign in to comment.