reformatted

This commit is contained in:
waltem01 2023-11-30 13:07:07 +01:00
parent 68458b9ad5
commit bf3c738ef0

View File

@ -1,5 +1,5 @@
import type { APIResponse } from "$lib/interfaces"; import type { APIResponse } from '$lib/interfaces';
import { json, type RequestHandler } from "@sveltejs/kit"; import { json, type RequestHandler } from '@sveltejs/kit';
// GET Endpoint for redirection API // GET Endpoint for redirection API
export const GET: RequestHandler = async ({ url }) => { export const GET: RequestHandler = async ({ url }) => {
@ -11,7 +11,7 @@ export const GET: RequestHandler = async ({ url }) => {
// Call API and respond with new data // Call API and respond with new data
const api_call = await fetch(`http://localhost:8080/${endpoint}`); const api_call = await fetch(`http://localhost:8080/${endpoint}`);
const data = await api_call.json() as APIResponse; const data = (await api_call.json()) as APIResponse;
return json(data); return json(data);
}; };
@ -31,6 +31,6 @@ export const POST: RequestHandler = async ({ request }) => {
mode: 'cors', mode: 'cors',
body: formData body: formData
}); });
const data = await api_call.json() as APIResponse; const data = (await api_call.json()) as APIResponse;
return json(data); return json(data);
}; };