mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-25 03:31:44 +00:00
reformatted
This commit is contained in:
parent
68458b9ad5
commit
bf3c738ef0
@ -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);
|
||||
};
|
Loading…
Reference in New Issue
Block a user