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 { 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);
};