aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/locations/+server.ts
blob: 987459bce22f5c88cf47cde2b1ebe4f3004e8413 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { get } from "$lib/utils";
import { json } from "@sveltejs/kit";

export async function GET({ setHeaders }) {
  let locations = [];

  try {
    ({ locations } = await get("/locations"));
    setHeaders({ "cache-control": "public, max-age=600" });
  } catch (e) {
    console.log("failed to fetch locations");
  }

  return json({ locations });
}