From fd132ebf97872f9551477559f17b5917fd2e9163 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 11 May 2024 16:26:17 +0100 Subject: [PATCH] Add time slot selection Stop moving elements when error appears under input make 404, 500, Empty Basket and No Item sections larger clean up test-api slightly --- front/src/lib/test-api.ts | 17 +--- front/src/pages/Page404.svelte | 6 +- front/src/pages/Page500.svelte | 6 +- front/src/pages/PageBooking.svelte | 97 +++++++++++++++++--- front/src/pages/PageCart.svelte | 4 +- front/src/pages/PageContact.svelte | 131 +++++++++++++--------------- front/src/pages/PageItem.svelte | 4 +- front/src/styles/_form_element.scss | 4 +- 8 files changed, 166 insertions(+), 103 deletions(-) diff --git a/front/src/lib/test-api.ts b/front/src/lib/test-api.ts index b840970..f45fcd5 100644 --- a/front/src/lib/test-api.ts +++ b/front/src/lib/test-api.ts @@ -74,19 +74,10 @@ export async function getItemsByUUID(items: string[]): Promise { } export async function getItemByUUID(uuid: string): Promise { - const data: Item[] = []; - - await getItemsByUUID([uuid]) - .then((result) => { - if (result.length !== 1) { - throw new Error("Resource could not be found"); - } - data.push(...result); - }) - .catch((error) => { - throw error; - }); - + const data = await getItemsByUUID([uuid]) + if (data.length !== 1) { + throw new Error("Resource could not be found"); + } return data[0]; } diff --git a/front/src/pages/Page404.svelte b/front/src/pages/Page404.svelte index fd10d2c..d3b3dec 100644 --- a/front/src/pages/Page404.svelte +++ b/front/src/pages/Page404.svelte @@ -11,12 +11,12 @@ @import "../styles/vars"; div { - padding: $spacing-large; - - height: 100%; + height: 400px; display: flex; flex-direction: column; + justify-content: center; + align-items: center; } h1 { display: flex; diff --git a/front/src/pages/Page500.svelte b/front/src/pages/Page500.svelte index 2a6bbe6..3200ebd 100644 --- a/front/src/pages/Page500.svelte +++ b/front/src/pages/Page500.svelte @@ -11,12 +11,12 @@ @import "../styles/vars"; div { - padding: $spacing-large; - - height: 100%; + height: 400px; display: flex; flex-direction: column; + justify-content: center; + align-items: center; } h1 { display: flex; diff --git a/front/src/pages/PageBooking.svelte b/front/src/pages/PageBooking.svelte index 8edc242..29081dc 100644 --- a/front/src/pages/PageBooking.svelte +++ b/front/src/pages/PageBooking.svelte @@ -1,4 +1,6 @@