From e60ff198d2c42612c5773f918e96f19c0531728f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 12:31:43 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in 18b22e7 according to the output from Prettier. Details: None --- front/src/lib/api.ts | 2 +- front/src/lib/test-api.ts | 14 +++++++++++--- front/src/lib/types.ts | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/front/src/lib/api.ts b/front/src/lib/api.ts index 6117cdc..d21492a 100644 --- a/front/src/lib/api.ts +++ b/front/src/lib/api.ts @@ -4,7 +4,7 @@ const API_URL = "http://127.0.0.1:8080"; export async function getPopularToday(): Promise { const response = await fetch(`${API_URL}/api/items`); - const {data, error}: JSONResponse = await response.json(); + const { data, error }: JSONResponse = await response.json(); if (response.ok) { if (data?.item) { diff --git a/front/src/lib/test-api.ts b/front/src/lib/test-api.ts index 3162d07..391b87a 100644 --- a/front/src/lib/test-api.ts +++ b/front/src/lib/test-api.ts @@ -25,7 +25,9 @@ export async function getPopularToday(): Promise { return cache["popular_today"]; } -export async function getMenuItems(): Promise<{ name: string; items: Item[] }[]> { +export async function getMenuItems(): Promise< + { name: string; items: Item[] }[] +> { await fakeDelay(20); return [ { @@ -66,7 +68,11 @@ export async function getItemByUUID(uuid: string): Promise { return data[0]; } -export async function postContactEmail(name: string, email: string, message: string): Promise { +export async function postContactEmail( + name: string, + email: string, + message: string +): Promise { await fakeDelay(200); if (!name) throw new Error("Name missing"); @@ -77,7 +83,9 @@ export async function postContactEmail(name: string, email: string, message: str return "Check your email to confirm the message!"; } -export async function postVerifyCart(cartData: Record): Promise> { +export async function postVerifyCart( + cartData: Record +): Promise> { let verifiedItems: Item[] = []; try { diff --git a/front/src/lib/types.ts b/front/src/lib/types.ts index cdf71b5..2af39c7 100644 --- a/front/src/lib/types.ts +++ b/front/src/lib/types.ts @@ -23,7 +23,7 @@ export type CartItem = { export type JSONResponse = { data?: { - item: Item[], // Todo Make this not just item type + item: Item[]; // Todo Make this not just item type }; error?: string; };