refac: 장수 삭제를 api로 이동

This commit is contained in:
2022-07-02 02:43:10 +09:00
parent 398c11e607
commit 687559a1a3
6 changed files with 81 additions and 84 deletions
+1
View File
@@ -125,6 +125,7 @@ const apiRealPath = {
DropItem: PUT as APICallT<{
itemType: ItemTypeKey;
}>,
DieOnPrestart: POST as APICallT<undefined>,
},
Global: {
GeneralList: GET as APICallT<undefined, GeneralListResponse>,
+2 -15
View File
@@ -130,22 +130,15 @@ $(function ($) {
});
$('#die_immediately').on('click', async function (e) {
$('#dieOnPrestart').on('click', async function (e) {
e.preventDefault();
if (!confirm('정말로 삭제하시겠습니까?')) {
return false;
}
let result: InvalidResponse;
try {
const response = await axios({
url: 'j_die_immediately.php',
method: 'post',
responseType: 'json',
});
result = response.data;
await SammoAPI.General.DieOnPrestart();
}
catch (e) {
console.log(e);
@@ -154,12 +147,6 @@ $(function ($) {
return;
}
if (!result.result) {
alert(`실패했습니다: ${result.reason}`);
location.reload();
return;
}
location.replace('..');
});