debian-mirror-gitlab/app/assets/javascripts/pages/projects/tags/remove_tag.js
2021-03-11 19:13:27 +05:30

16 lines
458 B
JavaScript

import initConfirmModal from '~/confirm_modal';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
export const initRemoveTag = ({ onDelete = () => {} }) => {
return initConfirmModal({
handleSubmit: (path = '') =>
axios
.delete(path)
.then(() => onDelete(path))
.catch(({ response: { data } }) => {
const { message } = data;
createFlash({ message });
}),
});
};