mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-05-20 18:34:53 +00:00
style: format code with Prettier
This commit fixes the style issues introduced in 6e31b44
according to the output
from Prettier.
Details: None
This commit is contained in:
parent
6e31b44137
commit
cd6fdf3b29
19 changed files with 131 additions and 105 deletions
|
@ -1,18 +1,15 @@
|
|||
import { type CartItem, type Item } from './types';
|
||||
import TestData from './test-data';
|
||||
|
||||
import { type CartItem, type Item } from "./types";
|
||||
import TestData from "./test-data";
|
||||
|
||||
let cache: Record<string, any> = {};
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
async function fakeDelay(timeout: number = 1000) {
|
||||
// @ts-ignore
|
||||
await new Promise((resolve: TimerHandler) => setTimeout(resolve, timeout));
|
||||
}
|
||||
|
||||
|
||||
export async function getAnnouncements(): Promise<{image: string}> {
|
||||
export async function getAnnouncements(): Promise<{ image: string }> {
|
||||
if (cache["announcement_banner"] !== undefined) {
|
||||
return cache["announcement_banner"];
|
||||
}
|
||||
|
@ -26,7 +23,6 @@ export async function getAnnouncements(): Promise<{image: string}> {
|
|||
return data;
|
||||
}
|
||||
|
||||
|
||||
export async function getPopularToday(): Promise<Item[]> {
|
||||
if (cache["popular_today"] !== undefined) {
|
||||
return cache["popular_today"];
|
||||
|
@ -39,8 +35,9 @@ export async function getPopularToday(): Promise<Item[]> {
|
|||
return data;
|
||||
}
|
||||
|
||||
|
||||
export async function getMenuItems(): Promise<{name: string, items: Item[]}[]> {
|
||||
export async function getMenuItems(): Promise<
|
||||
{ name: string; items: Item[] }[]
|
||||
> {
|
||||
await fakeDelay(20);
|
||||
return [
|
||||
{
|
||||
|
@ -58,7 +55,6 @@ export async function getMenuItems(): Promise<{name: string, items: Item[]}[]> {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
export async function getItemsByUUID(items: string[]): Promise<Item[]> {
|
||||
await fakeDelay(200);
|
||||
|
||||
|
@ -79,7 +75,6 @@ export async function getItemsByUUID(items: string[]): Promise<Item[]> {
|
|||
return data;
|
||||
}
|
||||
|
||||
|
||||
export async function getItemByUUID(uuid: string): Promise<Item> {
|
||||
let data: Item[];
|
||||
|
||||
|
@ -98,8 +93,11 @@ export async function getItemByUUID(uuid: string): Promise<Item> {
|
|||
return data[0];
|
||||
}
|
||||
|
||||
|
||||
export async function postContactEmail(name: string, email: string, message: string): Promise<string> {
|
||||
export async function postContactEmail(
|
||||
name: string,
|
||||
email: string,
|
||||
message: string
|
||||
): Promise<string> {
|
||||
await fakeDelay(200);
|
||||
|
||||
if (!name) {
|
||||
|
@ -117,7 +115,9 @@ export async function postContactEmail(name: string, email: string, message: str
|
|||
return "Check your email to confirm the message!";
|
||||
}
|
||||
|
||||
export async function postVerifyCart(currentCartData: Record<string, CartItem>): Promise<Record<string, CartItem>> {
|
||||
export async function postVerifyCart(
|
||||
currentCartData: Record<string, CartItem>
|
||||
): Promise<Record<string, CartItem>> {
|
||||
let verifiedItems: Item[] = [];
|
||||
|
||||
await getItemsByUUID(Object.keys(currentCartData))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue