1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9506],{9497:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/portal/[portal]/dashboard/entities/edit/[id]",function(){return s(54693)}])},54693:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return b}});var n=s(52676),a=s(1629),i=s(78619),d=s(75271),l=s(50924),c=s(4497),r=s(91750),u=s(16765),o=s(29820),h=s(57394),m=s.n(h),x=s(63534),p=s(34090),f=s(19719),j=s(31785),v=s(90394),w=s(41501),N=s(42474),_=s(38254),y=s(23799),g=s(97883),b=!0;t.default=()=>{let{portal:e}=(0,d.useContext)(g.w),t=(0,a.useRouter)(),{id:s}=t.query,{t:h}=(0,i.$G)(),{newNotification:b}=(0,d.useContext)(j.u),{alert:E,isOpen:Z,showAlert:T}=(0,w.ZP)(),{handlePermission:S}=(0,N.a)({middleware:["auth"]}),{handleEntityValidation:k}=(0,_.Z)(),[O,P]=(0,d.useState)({}),{handleSubmit:C,register:U,setValue:F,watch:X,formState:{isSubmitting:q}}=(0,c.cI)(),handleUpdateEntity=async s=>{if(0===k(s,O,P,e).length){s.name=JSON.stringify(s.name);try{await o.c.update(s),b("success",h("common.successOperation")),t.push("/dashboard/entities")}catch(e){var n;(0,v.xg)((null===(n=e.response)||void 0===n?void 0:n.data)||e,null,T)}}};return(0,d.useEffect)(()=>{let fetchEntity=async()=>{let e=await o.c.show(s);F("name",e.data.data.name)};fetchEntity()},[]),(0,d.useEffect)(()=>{S(["dynamic.update"])||t.push("/dashboard")},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(p.Z,{isTenant:!0,children:[(0,n.jsx)(m(),{children:(0,n.jsx)("title",{children:h("entities.edit.pageTitle")})}),(0,n.jsx)("div",{className:"max-w-screen-2xl mx-auto",children:(0,n.jsxs)("div",{className:"bg-white overflow-hidden shadow-sm rounded-lg",children:[(0,n.jsxs)("div",{className:"flex flex-col pt-6 pl-6",children:[(0,n.jsx)("div",{className:"bg-white font-bold text-xl sm:text-2xl text-black",children:h("entities.edit.pageTitle")}),(0,n.jsx)("div",{children:(0,n.jsx)(x.Z,{})})]}),Z&&E(),(0,n.jsx)("div",{className:"p-6",children:(0,n.jsxs)("form",{onSubmit:C(handleUpdateEntity),children:[(0,n.jsx)("input",{type:"hidden",...U("id"),value:s}),(0,n.jsx)("input",{type:"hidden",...U("_method"),value:"PUT"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(f.Z,{htmlFor:"name",children:h("common.name")}),(0,n.jsx)(y.Z,{inputType:"input",data:X(),setValue:F,name:"name"})]}),(0,n.jsx)(u.Z,{message:null==O?void 0:O.translations,className:"mt-2"}),(0,n.jsx)("div",{className:"flex justify-end mt-3",children:(0,n.jsx)(l.Z,{type:"submit",className:"bg-ogovOrange",disabled:q,children:q?(0,n.jsx)(r.g,{className:"w-5 h-5 mr-2"}):h("common.save")})})]})})]})})]})})}}},function(e){e.O(0,[3043,4497,4090,7166,9774,2888,179],function(){return e(e.s=9497)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.