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