diff --git a/front/src/lib/api.ts b/front/src/lib/api.ts index a0ff166..4b69c00 100644 --- a/front/src/lib/api.ts +++ b/front/src/lib/api.ts @@ -5,16 +5,16 @@ 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) { return data?.item; } else { - return Promise.reject(new Error("Failed to fetch popular today")) + return Promise.reject(new Error("Failed to fetch popular today")); } } else { - return Promise.reject(error) + return Promise.reject(error); } } diff --git a/front/src/lib/types.ts b/front/src/lib/types.ts index 2758c02..91758d3 100644 --- a/front/src/lib/types.ts +++ b/front/src/lib/types.ts @@ -14,14 +14,14 @@ export type Item = { description: string; labels?: Labels[]; images?: string[]; -} +}; export type CartItem = { amount: number; data: Item; -} +}; export type JSONResponse = { - data?: { item: Item[] } - error?: string, -} \ No newline at end of file + data?: { item: Item[] }; + error?: string; +};