Unverified Commit 4a522689 authored by Peter Kellner's avatar Peter Kellner Committed by GitHub

docs: Update route handles TS code snippets (#59021)

parent 3caa2891
...@@ -99,7 +99,7 @@ export async function GET(request: Request) { ...@@ -99,7 +99,7 @@ export async function GET(request: Request) {
const res = await fetch(`https://data.mongodb-api.com/product/${id}`, { const res = await fetch(`https://data.mongodb-api.com/product/${id}`, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'API-Key': process.env.DATA_API_KEY, 'API-Key': process.env.DATA_API_KEY!,
}, },
}) })
const product = await res.json() const product = await res.json()
...@@ -132,7 +132,7 @@ export async function POST() { ...@@ -132,7 +132,7 @@ export async function POST() {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'API-Key': process.env.DATA_API_KEY, 'API-Key': process.env.DATA_API_KEY!,
}, },
body: JSON.stringify({ time: new Date().toISOString() }), body: JSON.stringify({ time: new Date().toISOString() }),
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment