import{d as k,a as D,M as E,E as C,c as p,b as h,e as t,w as u,o as n,u as r,aU as w,f as c,aV as g,aW as m,aX as d}from"./index-562c8470.js";import{u as x}from"./usePageTitle-ad3dbf10.js";const S=k({__name:"DeploymentEdit",setup(B){const o=D(),a=E("deploymentId"),i={interval:3e5},y=C(o.deployments.getDeployment,[a.value],i),e=p(()=>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 v=p(()=>e.value?`Edit Deployment: ${e.value.name}`:"Edit Deployment");return x(v),(l,s)=>{const b=h("p-layout-default");return n(),t(b,{class:"deployment-edit"},{header:u(()=>[e.value?(n(),t(r(w),{key:0,deployment:e.value},null,8,["deployment"])):c("",!0)]),default:u(()=>[e.value?(n(),t(r(g),{key:0,deployment:e.value,onSubmit:_,onCancel:f},null,8,["deployment"])):c("",!0)]),_:1})}}});export{S as default};
