feat(subscription): 종료 청약 일괄 삭제 버튼 추가
AnnouncementsTab 툴바에 '🗑 종료 청약 삭제' 버튼 추가. 확인 다이얼로그 → DELETE /api/realestate/announcements/closed 호출 → 삭제 건수 알림 후 목록 새로고침. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -636,6 +636,19 @@ function AnnouncementsTab() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleDeleteClosed = async () => {
|
||||||
|
if (!confirm('종료된(완료) 청약 공고를 모두 삭제할까요?')) return;
|
||||||
|
try {
|
||||||
|
const res = await apiDelete('/api/realestate/announcements/closed');
|
||||||
|
alert(`${res.deleted || 0}건 삭제되었습니다.`);
|
||||||
|
setPage(1);
|
||||||
|
load();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Delete closed error:', e);
|
||||||
|
alert('삭제 실패');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleBookmark = async (id) => {
|
const handleBookmark = async (id) => {
|
||||||
try {
|
try {
|
||||||
const updated = await apiPatch(`/api/realestate/announcements/${id}/bookmark`);
|
const updated = await apiPatch(`/api/realestate/announcements/${id}/bookmark`);
|
||||||
@@ -680,6 +693,14 @@ function AnnouncementsTab() {
|
|||||||
onChange={(e) => { setRegionFilter(e.target.value); setPage(1); }}
|
onChange={(e) => { setRegionFilter(e.target.value); setPage(1); }}
|
||||||
style={{ width: 160, padding: '6px 12px', fontSize: 12 }}
|
style={{ width: 160, padding: '6px 12px', fontSize: 12 }}
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
className="sub-filter-btn"
|
||||||
|
onClick={handleDeleteClosed}
|
||||||
|
style={{ fontSize: 12, color: '#f87171' }}
|
||||||
|
title="status='완료' 공고 일괄 삭제"
|
||||||
|
>
|
||||||
|
🗑 종료 청약 삭제
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user