From bd8c4e590f99c532077b829f60b10006aa0882a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Tue, 7 Jun 2022 14:55:20 +0200 Subject: [PATCH] Add types to Swell route api --- src/routes/api/swell.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/api/swell.ts b/src/routes/api/swell.ts index c8708d9..7e941a1 100644 --- a/src/routes/api/swell.ts +++ b/src/routes/api/swell.ts @@ -1,3 +1,4 @@ +import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { getProducts, getProduct, @@ -10,7 +11,7 @@ import { // Block GET requests -export async function get ({ url, body }) { +export async function get({}: RequestEvent): Promise { return { status: 403, body: 'nope!' @@ -21,7 +22,7 @@ export async function get ({ url, body }) { /** * POST request */ -export async function post ({ request, params }) { +export async function post ({ request }: RequestEvent): Promise { try { const body = await request.json() const { action, cartId, productId } = body