From bf3c738ef06459efdf576893f132e9afb2e86d60 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Thu, 30 Nov 2023 13:07:07 +0100 Subject: [PATCH] reformatted --- Webserver/src/routes/api/redirect/+server.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Webserver/src/routes/api/redirect/+server.ts b/Webserver/src/routes/api/redirect/+server.ts index b163d7e..f99b621 100644 --- a/Webserver/src/routes/api/redirect/+server.ts +++ b/Webserver/src/routes/api/redirect/+server.ts @@ -1,5 +1,5 @@ -import type { APIResponse } from "$lib/interfaces"; -import { json, type RequestHandler } from "@sveltejs/kit"; +import type { APIResponse } from '$lib/interfaces'; +import { json, type RequestHandler } from '@sveltejs/kit'; // GET Endpoint for redirection API export const GET: RequestHandler = async ({ url }) => { @@ -11,7 +11,7 @@ export const GET: RequestHandler = async ({ url }) => { // Call API and respond with new data 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); }; @@ -31,6 +31,6 @@ export const POST: RequestHandler = async ({ request }) => { mode: 'cors', body: formData }); - const data = await api_call.json() as APIResponse; + const data = (await api_call.json()) as APIResponse; return json(data); -}; \ No newline at end of file +};