style: format code with Prettier

This commit fixes the style issues introduced in 1fdb6ed according to the output
from Prettier.

Details: None
This commit is contained in:
deepsource-autofix[bot] 2024-05-13 11:11:28 +00:00 committed by GitHub
parent 1fdb6ed2f4
commit 0592a217e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -5,16 +5,16 @@ const API_URL = "http://127.0.0.1:8080";
export async function getPopularToday(): Promise<Item[]> {
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);
}
}

View file

@ -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,
}
data?: { item: Item[] };
error?: string;
};