diff --git a/src/components/Card/TagRow.astro b/src/components/Card/TagRow.astro index e1a644e..d9f8646 100644 --- a/src/components/Card/TagRow.astro +++ b/src/components/Card/TagRow.astro @@ -6,7 +6,7 @@ const { tags } = Astro.props { (tags ?? []).map(tag => ( {tag.name} diff --git a/src/components/Header.astro b/src/components/Header.astro index 28dd602..89595c5 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -7,8 +7,9 @@
\ No newline at end of file diff --git a/src/data/pocketbase.ts b/src/data/pocketbase.ts index ef6d8de..8684c0a 100644 --- a/src/data/pocketbase.ts +++ b/src/data/pocketbase.ts @@ -29,7 +29,7 @@ class APIClient { // IMAGE async getImageURL(imgID: string, relative: boolean = true) { - const record = await this.client.collection("images").getOne(imgID) + const record = await this.client.collection(Collection.IMAGES).getOne(imgID) const res = this.client.files.getURL(record, record.image) return relative ? res.substring(21) : res } @@ -44,6 +44,28 @@ class APIClient { return urls } + async getAllTags() { + return await this.client.collection
+ {recipes.length} { recipes.length == 1 ? "Recipe" : "Recipes" } with: {name}
+
+ {tags.length} Tags +
+ { + (tags ?? []).map((t, i) => ( + //{t.name} -> {countsPerTag[i]} {countsPerTag[i] == 1 ? "Recipe" : "Recipes" }
+ + {t.name} ({countsPerTag[i]}) +