import{d as D,D as k,b as h,Y as C,e as u,c as t,h as p,i as E,o as n,u as r,a$ as g,a as c,b0 as w,b1 as m,b2 as d}from"./index-WCZ_4nWW.js";import{u as x}from"./usePageTitle-Y7n4a-YH.js";const Y=D({__name:"DeploymentEdit",setup(B){const o=k(),a=h("deploymentId"),i={interval:3e5},y=C(o.deployments.getDeployment,[a.value],i),e=u(()=>y.response);async function _(l){try{await o.deployments.updateDeployment(a.value,l),m("Deployment updated","success"),d.back()}catch(s){m("Error updating deployment","error"),console.warn(s)}}function f(){d.back()}const b=u(()=>e.value?`Edit Deployment: ${e.value.name}`:"Edit Deployment");return x(b),(l,s)=>{const v=E("p-layout-default");return n(),t(v,{class:"deployment-edit"},{header:p(()=>[e.value?(n(),t(r(g),{key:0,deployment:e.value},null,8,["deployment"])):c("",!0)]),default:p(()=>[e.value?(n(),t(r(w),{key:0,deployment:e.value,onSubmit:_,onCancel:f},null,8,["deployment"])):c("",!0)]),_:1})}}});export{Y as default};
