jquery Append() 내의 If 문
$('#somediv').append( 'html before' + (i > 0 ? '<img src="/img.jpg"/>': '') + 'more html' );
var my_id = JSON.parse(localStorage.getItem(['payload'])).user_id
var profile_id = response_json.id
if(response_json.review_set.length){
response_json.review_set.forEach(item => {
$('#my-review').append(
`
<div class="review-box">
<div class="row" style="margin:0;">
<div class="col-md-4" style="padding:0;">
<img class="review-img"token interpolation">${item.id},${item.place.id})" alt="후기 사진" src="${backendBaseUrl}${item.review_image_one}">
</div>
<div class="col-md-6" style="flex-basis:66.6666666%; max-width: 100%;">
<div class="card-body">
<h6 style="cursor:pointer;color: #ffbf60;"token interpolation">${item.id},${item.place.id},${item.author_id})">${item.place_name}</h6>
<p>평점 ${item.rating_cnt} / 5</p>
<div style="display:flex; width:50%;">`+
(my_id == profile_id? '<button class="update-review" onclick=move_to_edit_page(${item.place_id}, ${item.id})>리뷰 수정</button> <button class="update-review">리뷰 삭제</button>':'')
+`</div>
</div>
</div>
</div>
`
)
});
(my_id == profile_id? '<button class="update-review" onclick=move_to_edit_page(${item.place_id}, ${item.id})>리뷰 수정</button> <button class="update-review">리뷰 삭제</button>':'')
payload의 user_id 와 profile_id가 동일하면 리뷰수정/삭제 버튼 생성