File: /var/www/quadcode.com/.svelte-kit/adapter-node/entries/endpoints/api/events/getEvents/_server.ts.js
import{j as o}from"../../../../../chunks/index.js";import{l as a}from"../../../../../chunks/index3.js";import{b as i}from"../../../../../chunks/shared-server.js";const l=async r=>{const{request:n}=r,t=await n.json();t.lang_by_browser=a.get();const e=await fetch(`${i.PRIVATE_WP_URL}/wp-json/api/v1/events?lang=${t.language}`,{method:"POST",headers:{"content-type":"Application/json"},body:JSON.stringify({isPast:t.isPast,offset:t.offset,limit:t.limit})}),s=await e.json();return e.ok?o(s,{status:200}):s.errors?o({...s.errors},{status:403}):o({error:"Something went wrong"},{status:429})};export{l as POST};