Skip to content

Commit

Permalink
new version 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tsviz committed Jul 10, 2023
1 parent be69c47 commit 61ac7f1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}:${{ github.run_number }}
ghcr.io/${{ github.repository }}:latest
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest # use the docker layer caching to speed up the docker image build process
cache-to: type=inline
# cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest # use the docker layer caching to speed up the docker image build process
# cache-to: type=inline

runner-indexes: # job to generate the runner indexes for the unit-parallel-tests job
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>net.codejava</groupId>
<artifactId>salesmanager</artifactId>
<version>0.0.8-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/net/codejava/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public String delete(@PathVariable(name = "id") int id) {
return "redirect:/";
}

// method to clear the amount column in the database given an id
@RequestMapping("/clear/{id}")
public String clearAmount(@PathVariable(name = "id") int id) {
dao.clearAmount(id);
return "redirect:/";
}
// // method to clear the amount column in the database given an id
// @RequestMapping("/clear/{id}")
// public String clearAmount(@PathVariable(name = "id") int id) {
// dao.clearAmount(id);
// return "redirect:/";
// }
}
10 changes: 5 additions & 5 deletions src/main/java/net/codejava/SalesDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public void delete(int id) {
jdbcTemplate.update(sql, id);
}

// method to clear the amount column in the database given an id
public void clearAmount(int id) {
String sql = "UPDATE SALES SET amount=0 WHERE id=?";
jdbcTemplate.update(sql, id);
}
// // method to clear the amount column in the database given an id
// public void clearAmount(int id) {
// String sql = "UPDATE SALES SET amount=0 WHERE id=?";
// jdbcTemplate.update(sql, id);
// }
}
4 changes: 2 additions & 2 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ <h1>Sales Records</h1>
&nbsp;&nbsp;&nbsp;
<a th:href="@{'/delete/' + ${sale.id}}">Delete</a>
<!-- add a clear button to clear the amount given by id -->
&nbsp;&nbsp;&nbsp;
<a th:href="@{'/clear/' + ${sale.id}}">Clear</a>
<!-- &nbsp;&nbsp;&nbsp; -->
<!-- <a th:href="@{'/clear/' + ${sale.id}}">Clear</a> -->
</td>
</tr>
</tbody>
Expand Down

0 comments on commit 61ac7f1

Please sign in to comment.