antragstracker/static/_app/immutable/chunks/nhOotKLT.js

2 lines
1017 B
JavaScript
Raw Normal View History

const r=typeof window<"u"&&window.location.port==="5173"?`http://${window.location.hostname}:8099/api`:"/api";async function n(t){const e=await fetch(`${r}${t}`);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}const s=t=>{const e=new URLSearchParams(t).toString();return n(`/vorlagen?${e}`)},c=t=>n(`/vorlagen/${t}`),i=t=>{const e=new URLSearchParams(t).toString();return n(`/ketten?${e}`)},h=t=>n(`/ketten/${t}`);async function a(t,e){const o=await fetch(`${r}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`API error: ${o.status}`);return o.json()}const f=(t,e)=>a(`/bewertung/vorlagen/${t}`,{anmerkung:e}),g=(t,e)=>a(`/bewertung/ketten/${t}`,{anmerkung:e}),$=t=>n(`/bewertung/status/${t}`),u=t=>n(`/vorlagen/suggest?q=${encodeURIComponent(t)}`),w=()=>n("/fraktionen"),d=(t,e)=>{const o=e?`?jahr=${e}`:"";return n(`/fraktionen/${t}/dashboard${o}`)};export{i as a,c as b,h as c,$ as d,g as e,w as f,u as g,s as h,d as i,f as r};