diff --git a/src/main/java/com/eactive/httpmockserver/client/service/ApiRequestMgmtService.java b/src/main/java/com/eactive/httpmockserver/client/service/ApiRequestMgmtService.java
index 1dbe86e..22b414d 100644
--- a/src/main/java/com/eactive/httpmockserver/client/service/ApiRequestMgmtService.java
+++ b/src/main/java/com/eactive/httpmockserver/client/service/ApiRequestMgmtService.java
@@ -84,6 +84,7 @@ public class ApiRequestMgmtService {
collection.getApis().remove(api);
apiCollectionRepository.save(collection);
+ apiRequestRepository.deleteById(apiId);
}
}
diff --git a/src/main/resources/templates/page/tester/apiTester.html b/src/main/resources/templates/page/tester/apiTester.html
index 48f7abb..c0b18fe 100644
--- a/src/main/resources/templates/page/tester/apiTester.html
+++ b/src/main/resources/templates/page/tester/apiTester.html
@@ -61,9 +61,8 @@
-
@@ -433,9 +432,8 @@
controller.addQueryParam(idx, '', '');
});
- model.server = target.find('select[name="server"]').val();
target.find('input[name="basePath"]').val(target.find('select[name="server"] option:selected').data('path'));
-
+ target.find('select[name="server"]').val(model.server);
target.find('select[name="server"]').on('change', function () {
model.server = $(this).val();
let selected = $(this).find('option:selected');
@@ -814,7 +812,7 @@
console.log(model);
this.currentAjaxRequest = $.ajax({
- url: '/mgmt/collections/{id}/apis/save.do'.replace('{id}', model.collectionId),
+ url: '/mgmt/collections/{collectionId}/apis/save.do'.replace('{collectionId}', model.collectionId),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(model),
@@ -840,6 +838,7 @@
headers: [],
queryParams: [],
requestBody: '',
+ collectionId : collectionId,
responseModel: {
status: 0,
time: 0,
@@ -850,7 +849,7 @@
};
this.currentAjaxRequest = $.ajax({
- url: '/mgmt/collections/{id}/apis/save.do'.replace('{id}', collectionId),
+ url: '/mgmt/collections/{collectionId}/apis/save.do'.replace('{collectionId}', collectionId),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(newApi),