diff options
author | 2022-03-17 08:31:01 -0400 | |
---|---|---|
committer | 2022-03-17 08:31:01 -0400 | |
commit | 7b9d042dde0c6ae74225de208222e0addf5f4989 (patch) | |
tree | 6608058747d68e2e045df27e2c7c25f9e56beabf /examples/ssr/src | |
parent | f6709d7259ff67ddac302efb3d685cbe0c281e8f (diff) | |
download | astro-7b9d042dde0c6ae74225de208222e0addf5f4989.tar.gz astro-7b9d042dde0c6ae74225de208222e0addf5f4989.tar.zst astro-7b9d042dde0c6ae74225de208222e0addf5f4989.zip |
Allow SSR dynamic routes to not implement getStaticPaths (#2815)
* Allow SSR dynamic routes to not implement getStaticPaths
* Adds a changeset
* Update based on code-review comments
Diffstat (limited to 'examples/ssr/src')
-rw-r--r-- | examples/ssr/src/pages/products/[id].astro | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/examples/ssr/src/pages/products/[id].astro b/examples/ssr/src/pages/products/[id].astro index 9c400c2f1..37fe7e0b4 100644 --- a/examples/ssr/src/pages/products/[id].astro +++ b/examples/ssr/src/pages/products/[id].astro @@ -2,18 +2,9 @@ import Header from '../../components/Header.astro'; import Container from '../../components/Container.astro'; import AddToCart from '../../components/AddToCart.svelte'; -import { getProducts, getProduct } from '../../api'; +import { getProduct } from '../../api'; import '../../styles/common.css'; -export async function getStaticPaths() { - const products = await getProducts(); - return products.map(product => { - return { - params: { id: product.id.toString() } - } - }); -} - const id = Number(Astro.request.params.id); const product = await getProduct(id); --- |