refac: 장수 삭제를 api로 이동
This commit is contained in:
@@ -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
@@ -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('..');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user