Liferay.Loader.define("data-engine-taglib@3.3.53/data_layout_builder/js/components/field-sets/actions/useDeleteFieldSet.es",["module","exports","require","data-engine-js-components-web","../../../eventTypes","../../../utils/client.es","../../../utils/toast.es"],(function(e,t,a){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a("data-engine-js-components-web"),i=a("../../../eventTypes"),n=a("../../../utils/client.es"),o=a("../../../utils/toast.es");var _default=()=>{const e=(0,s.useForm)(),{fieldSets:t}=(0,s.useFormState)();return async a=>{try{const{ok:s}=await(0,n.deleteItem)("".concat("/o/data-engine/v2.0/data-definitions/").concat(a.id));if(!s)throw new Error;e({payload:{fieldSets:t.filter((({id:e})=>e!==a.id))},type:i.EVENT_TYPES.FIELD_SET.UPDATE_LIST}),(0,o.successToast)(Liferay.Language.get("the-item-was-deleted-successfully"))}catch(e){(0,o.errorToast)(Liferay.Language.get("the-item-could-not-be-deleted"))}}};t.default=_default}));
//# sourceMappingURL=useDeleteFieldSet.es.js.map