Skip to content

Commit 9ae3594

Browse files
kodster28KianNH
andauthored
[ResourcesBySelector] Error if no resources found (#24453)
* [ResourcesBySelector] Error if no resources found * Update ResourcesBySelector.astro * KV fixes --------- Co-authored-by: Kian <[email protected]>
1 parent 33dd748 commit 9ae3594

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

src/components/ResourcesBySelector.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ const resources: Array<CollectionEntry<"docs"> | CollectionEntry<"stream">> = [
5252
);
5353
});
5454
55+
if (resources.length === 0) {
56+
throw new Error(
57+
`[ResourcesBySelector] Couldn't resources related to your filtered options`,
58+
);
59+
}
60+
5561
const facets = resources.reduce(
5662
(acc, page) => {
5763
if (!filterables) return acc;

src/content/docs/kv/examples/cache-data-with-workers-kv.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
type: example
33
summary: Cache data or API responses in Workers KV to improve application performance
4-
pcx_content_type: configuration
4+
pcx_content_type: example
55
title: Cache data with Workers KV
66
sidebar:
77
order: 5

src/content/docs/kv/examples/distributed-configuration-with-workers-kv.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
type: example
33
summary: Use Workers KV to as a geo-distributed, low-latency configuration store for your Workers application
4-
pcx_content_type: configuration
4+
pcx_content_type: example
55
title: Build a distributed configuration store
66
sidebar:
77
order: 5

src/content/docs/kv/examples/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ import { GlossaryTooltip, ResourcesBySelector } from "~/components";
1313

1414
Explore the following <GlossaryTooltip term="code example">examples</GlossaryTooltip> for KV.
1515

16-
<ResourcesBySelector directory="kv/examples/" types={["example"]} />
16+
<ResourcesBySelector directory="kv" types={["example"]} />

src/content/docs/kv/examples/routing-with-workers-kv.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
type: example
33
summary: Store routing data in Workers KV to route requests across various web servers with Workers
4-
pcx_content_type: configuration
4+
pcx_content_type: example
55
title: Route requests across various web servers
66
sidebar:
77
order: 5

src/content/docs/kv/examples/workers-kv-to-serve-assets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
type: example
33
summary: Store static assets in Workers KV and serve them from a Worker application with low-latency and high-throughput
4-
pcx_content_type: configuration
4+
pcx_content_type: example
55
title: Store and retrieve static assets
66
sidebar:
77
order: 4

0 commit comments

Comments
 (0)