import{d,a as k,av as w,g as f,o as Q,h,w as l,i,j as o,aw as y,ax as g,ac as q,ab as p}from"./index.ace9693c.js";import{u as x}from"./useRouteParam.1483cbc1.js";import{u as C}from"./usePageTitle.12638eb5.js";const B=d({__name:"WorkQueueEdit",async setup(W){let e,u;const r=k(),t=x("id"),a=([e,u]=w(()=>r.workQueues.getWorkQueue(t.value)),e=await e,u(),e),s=()=>{q.back()},_=async n=>{try{await r.workQueues.updateWorkQueue(t.value,n),p(`${a.name} updated`,"success"),s()}catch(c){p("Error occurred while updating your queue","error"),console.error(c)}};return C(`Edit Work Queue: ${a.name}`),(n,c)=>{const m=f("p-layout-default");return Q(),h(m,null,{header:l(()=>[i(o(y),{"work-queue":o(a)},null,8,["work-queue"])]),default:l(()=>[i(o(g),{"work-queue":o(a),onSubmit:_,onCancel:s},null,8,["work-queue"])]),_:1})}}});export{B as default};
