Skip to content
Snippets Groups Projects
Commit df1fce19 authored by 정원제's avatar 정원제 :guitar:
Browse files

hotfix: pc 삭제 시 페이지가 갱신되도록 수정

parent b4858ba0
No related branches found
No related tags found
No related merge requests found
Pipeline #10885 passed
...@@ -86,9 +86,15 @@ const CertifiedCombination = () => { ...@@ -86,9 +86,15 @@ const CertifiedCombination = () => {
const handleDeletePC = async (pcId) => { const handleDeletePC = async (pcId) => {
try { try {
await deletePC(pcId); await deletePC(pcId);
setPcs(pcs.filter(pc => pc.id !== pcId)); const updatedPcs = pcs.filter(pc => pc.id !== pcId);
setPcs(updatedPcs);
if (selectedPc?.id === pcId) { if (selectedPc?.id === pcId) {
setSelectedPc(pcs.find(pc => pc.id !== pcId) || null); const nextPc = updatedPcs[0] || null;
setSelectedPc(nextPc);
if (!nextPc) {
setPartsData([]);
}
} }
} catch (error) { } catch (error) {
console.error("PC 삭제 중 오류 발생:", error); console.error("PC 삭제 중 오류 발생:", error);
......
...@@ -16,7 +16,7 @@ const Waiting = () => { ...@@ -16,7 +16,7 @@ const Waiting = () => {
setIsSuccess(true); setIsSuccess(true);
setTimeout(() => { setTimeout(() => {
navigate('/mycombination'); navigate('/mycombination');
}, 5000); }, 3000);
} }
} catch (error) { } catch (error) {
console.error('인증 상태 확인 중 오류 발생:', error); console.error('인증 상태 확인 중 오류 발생:', error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment