DB 컬럼 마이그레이션 추가 및 API 요청 저장 처리 수정

This commit is contained in:
현성필
2023-10-25 15:19:20 +09:00
parent 5770642f71
commit 43c4e993cc
3 changed files with 29 additions and 18 deletions
@@ -37,6 +37,10 @@ public class ApiRequestMigrationService {
try (Statement statement = connection.createStatement()) {
statement.execute(sql2);
}
String sql3 = String.format("ALTER TABLE %s ALTER COLUMN %s %s;", "API_REQUEST_INFO", "REQUEST_BODY", "CLOB");
try (Statement statement = connection.createStatement()) {
statement.execute(sql3);
}
} catch (Exception e) {
e.printStackTrace();
}
+22 -15
View File
@@ -366,7 +366,7 @@ class APITester {
showCollectionDeleteModal(event) {
const collectionId = $(event.currentTarget).closest('button').data('collection');
$('#confirm_delete_modal').find('.confirm_delete').attr('data-id', collectionId);
$('#confirm_delete_modal').find('.confirm_delete').data('id', collectionId);
$('#confirm_delete_modal').modal('show');
}
@@ -394,9 +394,9 @@ class APITester {
showDeleteApiRequestModal(event) {
let collectionId = $(event.currentTarget).closest('li').data('collection');
let apiId = $(event.currentTarget).closest('li').data('id');
$('#confirm_delete_api_modal').find('.confirm_delete_api').attr('data-id', apiId);
$('#confirm_delete_api_modal').find('.confirm_delete_api').attr('data-collection', collectionId);
console.log('apiId: ' + apiId);
$('#confirm_delete_api_modal').find('.confirm_delete_api').data('id', apiId);
$('#confirm_delete_api_modal').find('.confirm_delete_api').data('collection', collectionId);
$('#confirm_delete_api_modal').modal('show');
}
@@ -893,7 +893,7 @@ class APITester {
},
error: function (response, textStatus, errorThrown) {
me.hideLoadingOverlay();
$('.toast-body').text(response.responseJSON);
$('.toast-body').text(response.responseJSON.error);
$('.toast').toast('show');
},
complete: function () {
@@ -922,7 +922,7 @@ class APITester {
},
error: function (response, textStatus, errorThrown) {
me.hideLoadingOverlay();
$('.toast-body').text(response.responseJSON);
$('.toast-body').text(response.responseJSON.error);
$('.toast').toast('show');
},
complete: function () {
@@ -964,6 +964,8 @@ class APITester {
},
error: function (response, textStatus, errorThrown) {
me.hideLoadingOverlay();
$('.toast-body').text(response.responseJSON.error);
$('.toast').toast('show');
},
complete: function () {
me.loadCollections();
@@ -1031,10 +1033,19 @@ class APITester {
deleteApiRequest(event) {
let collectionId = $(event.currentTarget).closest('button').data('collection');
let apiId = $(event.currentTarget).closest('button').data('id');
let apiId = $(event.currentTarget).closest('.confirm_delete_api').data('id');
console.log(event.currentTarget);
console.log($(event.currentTarget));
console.log('deleteApiRequest: ' + apiId);
console.log('collectionId: ' + collectionId);
let apiIndex = this.apiRequests.findIndex(function (api) {
return api.id === apiId;
});
console.log(apiIndex);
if(apiIndex >= 0){
this.closeTabWithApiIndex(apiIndex);
}
const me = this;
let apiRequests = this.apiRequests;
this.currentAjaxRequest = $.ajax({
url: `/mgmt/collections/${collectionId}/apis/delete.do`,
type: 'POST',
@@ -1047,14 +1058,10 @@ class APITester {
},
complete: function () {
me.hideLoadingOverlay();
//get the api with apiIndex index from apiRequests
let apiIndex = apiRequests.findIndex(function (api) {
return api.id === apiId;
});
me.closeTabWithApiIndex(apiIndex);
me.loadCollections();
$('#confirm_delete_api_modal').modal('hide');
// $('#confirm_delete_api_modal').find('.confirm_delete_api').removeAttr('data-id');
// $('#confirm_delete_api_modal').find('.confirm_delete_api').removeAttr('data-collection');
}
});
}
@@ -8,9 +8,9 @@
<section layout:fragment="contentFragment">
<div class="container-fluid">
<div class="card mt-2">
<div class="card mt-4">
<div class="card-header">
<h3>응답 API 목록</h3>
<h5><span style="font-weight: bold">응답 API 목록</span></h5>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
@@ -35,7 +35,7 @@
</div>
</div>
</div>
<div class="card mt-2">
<div class="card mt-4">
<div class="card-body">
<form name="listForm">
<input name="id" type="hidden"/>