import{d as k,M as D,b as C,Y as E,e as u,c as t,i as p,j as h,o as n,u as r,a_ as g,a as c,a$ as w,b0 as m,b1 as d}from"./index-bD6G21oH.js";import{u as x}from"./usePageTitle-27XdpEbQ.js";const S=k({__name:"DeploymentEdit",setup(B){const o=D(),a=C("deploymentId"),i={interval:3e5},y=E(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 v=u(()=>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: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{S as default};
