diff --git a/README.md b/README.md index d7d4b3b..40d4abc 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ export default async function handler(_, res) { }; let reports = await getReport(opt); res.setHeader("Cache-Control", `public, max-age=${ttl}, stale-while-revalidate=300`).json({ - nodes: reports, + reports: reports, }); } ``` @@ -200,8 +200,8 @@ import { useEffect, useState } from "react"; const TopTrending = () => { const [trendingReports, setTrendingReports] = useState([]); useEffect(() => { - getTopTrendingReports().then((nodes) => { - setTrendingReports(nodes); + getTopTrendingReports().then((reports) => { + setTrendingReports(reports); }); }, []); @@ -228,7 +228,7 @@ async function getTopTrendingReports() { return []; } const reportNode = await response.json(); - return reportNode.nodes; + return reportNode.reports; } export default TopTrending; diff --git a/package.json b/package.json index 29b4a42..931b4b1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gatsby-plugin-google-analytics-data-reporting-api", "description": "Reporting API for Google Analytics 4 (GA4)", - "version": "2.0.0-beta1", + "version": "2.0.0-beta2", "main": "index.js", "author": "Ferry Suhandri", "license": "MIT",