[Project] 실수한 것

김호정's avatar
Oct 09, 2024
[Project] 실수한 것
async function cinemas(regionId) { // 1. get 요청하면 body 없다. // 2. 한줄 한줄 실행하면서 테스트 // 3. get 요청으로 데이터를 보내려면 주소에 담아 보낸다. (이유는? where 절에 쓸 것을 보내기 때문에) let response = await fetch("http://localhost:8080/reservation/region/" + regionId, { method: "get" }); let data = await response.json(); console.log("data ", data); console.log("body", data.body); console.log("cinemaList", data.body.cinemaList); let cinemaList = data.body.cinemaList; for (cinema of cinemaList) { $("#cinema-box").empty(); let dom = makeBox(cinema); $("#cinema-box").append(dom); } }
  1. get 요청하면 body가 없다 요청이니까 get 그러면 post는?
  1. 한줄 한줄 실행하면서 테스트하자
  1. get요청으로 데이터를 보내려면 주소에 담아 보낸다 ( 이유는? where 절에 쓸 것을 보내기 때문에)
  1. 로그 찍을 때 문자열 + 데이터는 문자열로 변해서 조심해야 한다 Ex) console.log(”data” + data) 하면 안됨 console.log(”data”, data) 해야함!
 
 
post는 바디에 데이터를 보내야 할 때 필요한건데
 
실수한 것
@Query("select st from Showtime st left join fetch st.movie mt where st.screen.id IN :ids ")
:ids 적을 때 :과 ids 사이를 띄우면 안되는데 띄워서 계속 못찾는다고 오류가남 주의하자!
Share article

keepgoing