fix(devstar home): now only response code is 0 that means successfully delete dev container

This commit is contained in:
Levi Yan
2024-10-28 17:14:54 +08:00
parent 5554ff4fb1
commit 98b1ed4a19

View File

@@ -801,10 +801,16 @@ header("Allow: GET, POST, OPTIONS, PUT, DELETE");
return response.json();
})
.then(data => {
console.log('Successfully delete dev container belong to repoId:', repoId, data)
const respCode = data.code;
if (0 == respCode) {
console.log('Successfully delete dev container belong to repoId:', repoId, data)
} else {
const errorMsg = data.data.ErrorMsg
throw new Error(errorMsg)
}
})
.catch(error => {
console.error(`Failed to delete dev container belong to repoId: ${repoId}`)
console.error(`Failed to delete dev container belong to repoId: ${repoId}\n`, error)
})
}