Loading vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/client/VOSpaceClient.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -160,7 +160,7 @@ public class VOSpaceClient { public void deleteCollection(Long id, Optional<String> token) { public void deleteCollection(Long id, Optional<String> token) { HttpRequest request = getRequest("/collections?id="+id, token) HttpRequest request = getRequest("/collections/"+id, token) .header("Accept", useJson ? "application/json" : "text/xml") .header("Accept", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .DELETE() .DELETE() Loading vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/controller/NodeCollectionsController.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController; Loading Loading @@ -61,4 +63,19 @@ public class NodeCollectionsController extends BaseController { return ResponseEntity.noContent().build(); return ResponseEntity.noContent().build(); } } @DeleteMapping(value = "/collections/{collectionId}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> deleteNodeCollection(User principal, @PathVariable Long collectionId) throws Exception { LOG.debug("delete collection {} for user {}", collectionId, principal.getName()); // Call creation logic client.deleteCollection(collectionId, tokenProvider.getToken()); return ResponseEntity.noContent().build(); } } } vospace-ui-frontend/src/api/server/index.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -128,7 +128,7 @@ export default { }); }); }, }, deleteCollection(collectionId) { deleteCollection(collectionId) { let url = BASE_API_URL + 'collections?id='+collectionId; let url = BASE_API_URL + 'collections/'+collectionId; return apiRequest({ return apiRequest({ method: 'DELETE', method: 'DELETE', url: url, url: url, Loading vospace-ui-frontend/src/components/Collections.vue +8 −2 Original line number Original line Diff line number Diff line Loading @@ -13,16 +13,17 @@ <div v-if="collections.length > 0" class="mb-3"> <div v-if="collections.length > 0" class="mb-3"> <table class="table b-table table-striped table-hover"> <table class="table b-table table-striped table-hover"> <thead> <thead> <tr> <th>Id</th> <th>Id</th> <th>Title</th> <th>Title</th> <th></th> <th>Actions</th> </tr> </tr> </thead> </thead> <tbody> <tbody> <tr v-for="collection in collections" :key="collection.id"> <tr v-for="collection in collections" :key="collection.id"> <td>{{collection.id}}</td> <td>{{collection.id}}</td> <td>{{collection.title}}</td> <td>{{collection.title}}</td> <td></td> <td><b-icon-trash color="red" @click="deleteCollection(collection.id)"/></td> </tr> </tr> </tbody> </tbody> </table> </table> Loading @@ -41,11 +42,13 @@ </template> </template> <script> <script> import { BIconTrash } from 'bootstrap-vue' import FAQModal from './modal/FAQModal.vue' import FAQModal from './modal/FAQModal.vue' import CreateCollectionModal from './modal/CreateCollectionModal.vue' import CreateCollectionModal from './modal/CreateCollectionModal.vue' export default { export default { components: { components: { BIconTrash, FAQModal, FAQModal, CreateCollectionModal CreateCollectionModal }, }, Loading @@ -60,6 +63,9 @@ export default { methods: { methods: { loadCollections() { loadCollections() { this.$store.dispatch('loadCollections'); this.$store.dispatch('loadCollections'); }, deleteCollection(id) { this.$store.dispatch('deleteCollection', id); } } } } } } Loading Loading
vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/client/VOSpaceClient.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -160,7 +160,7 @@ public class VOSpaceClient { public void deleteCollection(Long id, Optional<String> token) { public void deleteCollection(Long id, Optional<String> token) { HttpRequest request = getRequest("/collections?id="+id, token) HttpRequest request = getRequest("/collections/"+id, token) .header("Accept", useJson ? "application/json" : "text/xml") .header("Accept", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .DELETE() .DELETE() Loading
vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/controller/NodeCollectionsController.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController; Loading Loading @@ -61,4 +63,19 @@ public class NodeCollectionsController extends BaseController { return ResponseEntity.noContent().build(); return ResponseEntity.noContent().build(); } } @DeleteMapping(value = "/collections/{collectionId}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> deleteNodeCollection(User principal, @PathVariable Long collectionId) throws Exception { LOG.debug("delete collection {} for user {}", collectionId, principal.getName()); // Call creation logic client.deleteCollection(collectionId, tokenProvider.getToken()); return ResponseEntity.noContent().build(); } } }
vospace-ui-frontend/src/api/server/index.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -128,7 +128,7 @@ export default { }); }); }, }, deleteCollection(collectionId) { deleteCollection(collectionId) { let url = BASE_API_URL + 'collections?id='+collectionId; let url = BASE_API_URL + 'collections/'+collectionId; return apiRequest({ return apiRequest({ method: 'DELETE', method: 'DELETE', url: url, url: url, Loading
vospace-ui-frontend/src/components/Collections.vue +8 −2 Original line number Original line Diff line number Diff line Loading @@ -13,16 +13,17 @@ <div v-if="collections.length > 0" class="mb-3"> <div v-if="collections.length > 0" class="mb-3"> <table class="table b-table table-striped table-hover"> <table class="table b-table table-striped table-hover"> <thead> <thead> <tr> <th>Id</th> <th>Id</th> <th>Title</th> <th>Title</th> <th></th> <th>Actions</th> </tr> </tr> </thead> </thead> <tbody> <tbody> <tr v-for="collection in collections" :key="collection.id"> <tr v-for="collection in collections" :key="collection.id"> <td>{{collection.id}}</td> <td>{{collection.id}}</td> <td>{{collection.title}}</td> <td>{{collection.title}}</td> <td></td> <td><b-icon-trash color="red" @click="deleteCollection(collection.id)"/></td> </tr> </tr> </tbody> </tbody> </table> </table> Loading @@ -41,11 +42,13 @@ </template> </template> <script> <script> import { BIconTrash } from 'bootstrap-vue' import FAQModal from './modal/FAQModal.vue' import FAQModal from './modal/FAQModal.vue' import CreateCollectionModal from './modal/CreateCollectionModal.vue' import CreateCollectionModal from './modal/CreateCollectionModal.vue' export default { export default { components: { components: { BIconTrash, FAQModal, FAQModal, CreateCollectionModal CreateCollectionModal }, }, Loading @@ -60,6 +63,9 @@ export default { methods: { methods: { loadCollections() { loadCollections() { this.$store.dispatch('loadCollections'); this.$store.dispatch('loadCollections'); }, deleteCollection(id) { this.$store.dispatch('deleteCollection', id); } } } } } } Loading