20230324_TIL

오늘 한 일(회고)
- 프로젝트 페이지 연결 및 에러 해결
오늘은 뭔가 내가 생각했을 때 부족한 것들을 채우려고 한다.
- 병원 사진 이미지 업로드시에 우리 병원 이미지가 보이지 않는 점
- 의사 시간이 제대로 안나오는 점
- 페이지네이션 구현
이 중 1가지만 해도 성공이다… 일단 이미지 업로드시 우리 병원 이미짇가 나오게는 구현을 했다. 아래는 해당 코드다
// 프론트 코드
function getImageHospital() {
$.ajax({
type: 'GET',
url: '/api/hospitals/information/hospitalImage',
dataType: 'json',
success: function (response) {
const imagehospital = response;
let temp_html = `
<div id="bigimages">
<img id="bigimage"
src="${imagehospital[0].url}">
</div>
<div id="smallimages">
${imagehospital.map(image => `<img class="small" src="${image.url}">`).join('')}
</div>`;
$('#content-image').append(temp_html);
var bigPic = document.querySelector("#bigimage");
var smallPics = document.querySelectorAll(".small");
for (let i = 0; i < smallPics.length; i++) {
smallPics[i].addEventListener("click", changepic);
smallPics[i].onclick = changepic;
}
function changepic() {
let smallPicAttribute = this.getAttribute("src");
bigPic.setAttribute("src", smallPicAttribute);
}
}
})
}
이런식으로 구현을 했다.
오늘 할 일 끝…
내일 할일
- 프로젝트 마무리 작업