New Recipe
+ +Ingredients
+Ingredients
diff --git a/astro.config.mjs b/astro.config.mjs index 58360f6..47cc0d6 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -7,8 +7,6 @@ import tailwindcss from '@tailwindcss/vite'; import { loadEnv } from "vite"; -const { PUBLIC_PB_URL } = loadEnv(process.env.NODE_ENV, process.cwd(), ""); - // https://astro.build/config export default defineConfig({ output: 'server', @@ -19,5 +17,8 @@ export default defineConfig({ vite: { plugins: [tailwindcss()], + server: { + cors: false + } } }); \ No newline at end of file diff --git a/src/components/Detail/InfoView.astro b/src/components/Detail/InfoView.astro index 4bde49e..5da41b8 100644 --- a/src/components/Detail/InfoView.astro +++ b/src/components/Detail/InfoView.astro @@ -15,8 +15,19 @@ function formatTime(seconds) { return result; } -const workTime = formatTime(re.worktime) -const waitTime = formatTime(re.waittime) +function formatTimeMin(minutes) { + if (minutes === 0) return null + const h = Math.floor(minutes / 60); + const m = minutes % 60; + let result = ""; + if (h > 0) result += `${h}h`; + if (m > 0) result += `${m}m`; + if (result === "") result = "0m"; + return result; +} + +const workTime = formatTimeMin(re.worktime) +const waitTime = formatTimeMin(re.waittime) ---
{re.description}
diff --git a/src/data/pocketbase.ts b/src/data/pocketbase.ts index 8684c0a..7e68b9d 100644 --- a/src/data/pocketbase.ts +++ b/src/data/pocketbase.ts @@ -8,29 +8,29 @@ import { } from './schema' class APIClient { - client: Pocketbase + pb: Pocketbase constructor() { - this.client = new Pocketbase("http://localhost:4321") - this.client.autoCancellation(false) + this.pb = new Pocketbase("http://localhost:4321") + this.pb.autoCancellation(false) } async getRecipesPage(page: number, perPage: number = 30, options: RecordListOptions) { - return await this.client.collectionNew Recipe
+ +Ingredients
+Ingredients