import{d as _,S as h,v as b,j as g,g as p,h as D,c as k,a as C,o as E,i as r,k as c,m as u,c7 as S,ca as w,J as m,c9 as d,bg as x,Y as V}from"./index-CWv_Pcr2.js";import{u as Y}from"./usePageTitle-DY9DP8zZ.js";const J=_({__name:"DeploymentEdit",setup(j){const a=h(),t=b("deploymentId"),i={interval:3e5},s=g(a.deployments.getDeployment,[t.value],i),e=p(()=>s.response);async function y(l){try{await a.deployments.updateDeploymentV2(t.value,l),m("Deployment updated","success"),s.refresh(),d.push(x.deployment(t.value))}catch(o){const n=V(o,"Error updating deployment");m(n,"error"),console.warn(o)}}function f(){d.back()}const v=p(()=>e.value?`Edit Deployment: ${e.value.name}`:"Edit Deployment");return Y(v),(l,o)=>{const n=D("p-layout-default");return e.value?(E(),k(n,{key:0,class:"deployment-edit"},{header:r(()=>[c(u(w),{deployment:e.value},null,8,["deployment"])]),default:r(()=>[c(u(S),{deployment:e.value,onCancel:f,onSubmit:y},null,8,["deployment"])]),_:1})):C("",!0)}}});export{J as default};
//# sourceMappingURL=DeploymentEdit-BZIlF91W.js.map
