order by date menu
This commit is contained in:
parent
5c92159b53
commit
ff1df20b1f
3 changed files with 3 additions and 3 deletions
|
@ -67,7 +67,7 @@ public class MenuController {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mise a jour d'un menu par son ID
|
//Mise a jour d'un menu par son ID
|
||||||
@PutMapping("/update/{team_id}/{id}")
|
@PutMapping(value="/update/{team_id}/{id}", produces="application/json", consumes= "application/json")
|
||||||
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> updateMenu(@RequestBody Menu menu, @PathVariable Integer team_id, @PathVariable Integer id) throws Exception {
|
public ResponseEntity<?> updateMenu(@RequestBody Menu menu, @PathVariable Integer team_id, @PathVariable Integer id) throws Exception {
|
||||||
Menu resultMenu = null;
|
Menu resultMenu = null;
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class Menu {
|
||||||
private String repasSoir;
|
private String repasSoir;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name="TEAM_ID")
|
@JoinColumn(name="TEAM_ID")
|
||||||
@JsonIgnoreProperties({"menu","membre"})
|
@JsonIgnoreProperties({"menu"})
|
||||||
private Team team;
|
private Team team;
|
||||||
|
|
||||||
public Menu() {
|
public Menu() {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
@Repository
|
@Repository
|
||||||
public interface MenuRepository extends JpaRepository <Menu, Integer> {
|
public interface MenuRepository extends JpaRepository <Menu, Integer> {
|
||||||
|
|
||||||
@Query(value = "select * from menu where team_id = :team_id", nativeQuery = true)
|
@Query(value = "select * from menu where team_id = :team_id order by date_menu ASC", nativeQuery = true)
|
||||||
List<Menu> FindMenusByTeam(@Param("team_id") int team_id);
|
List<Menu> FindMenusByTeam(@Param("team_id") int team_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue