From 3e81c5006cb37f31be15e73cf0b2a525834d7800 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 23 Oct 2017 03:57:51 +0300 Subject: Fix deletion of container registry or images returning an error A successful DELETE call would result in a 204 No Content result, which would have an empty response body. Don't automatically try to parse this value as JSON both because there is no additional information passed in the response body. Closes #39354 --- app/assets/javascripts/registry/stores/actions.js | 6 ++---- changelogs/unreleased/sh-fix-container-registry-destroy.yml | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/sh-fix-container-registry-destroy.yml diff --git a/app/assets/javascripts/registry/stores/actions.js b/app/assets/javascripts/registry/stores/actions.js index 34ed40b8b65..795b39bb3dc 100644 --- a/app/assets/javascripts/registry/stores/actions.js +++ b/app/assets/javascripts/registry/stores/actions.js @@ -29,11 +29,9 @@ export const fetchList = ({ commit }, { repo, page }) => { }); }; -export const deleteRepo = ({ commit }, repo) => Vue.http.delete(repo.destroyPath) - .then(res => res.json()); +export const deleteRepo = ({ commit }, repo) => Vue.http.delete(repo.destroyPath); -export const deleteRegistry = ({ commit }, image) => Vue.http.delete(image.destroyPath) - .then(res => res.json()); +export const deleteRegistry = ({ commit }, image) => Vue.http.delete(image.destroyPath); export const setMainEndpoint = ({ commit }, data) => commit(types.SET_MAIN_ENDPOINT, data); export const toggleLoading = ({ commit }) => commit(types.TOGGLE_MAIN_LOADING); diff --git a/changelogs/unreleased/sh-fix-container-registry-destroy.yml b/changelogs/unreleased/sh-fix-container-registry-destroy.yml new file mode 100644 index 00000000000..21a463da62a --- /dev/null +++ b/changelogs/unreleased/sh-fix-container-registry-destroy.yml @@ -0,0 +1,5 @@ +--- +title: Fix deletion of container registry or images returning an error +merge_request: +author: +type: fixed -- cgit v1.2.1