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