diff --git a/src/pages/api/all-forecasts.ts b/src/pages/api/all-forecasts.ts deleted file mode 100644 index f10c55e..0000000 --- a/src/pages/api/all-forecasts.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NextApiRequest, NextApiResponse } from "next/types"; - -import { getFrontpageFull } from "../../backend/frontpage"; - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse -) { - let frontpageFull = await getFrontpageFull(); - console.log(frontpageFull.map((element) => element.title).slice(0, 5)); - console.log("..."); - res.status(200).json(frontpageFull); -} diff --git a/src/pages/api/notes.md b/src/pages/api/notes.md deleted file mode 100644 index 466857d..0000000 --- a/src/pages/api/notes.md +++ /dev/null @@ -1,15 +0,0 @@ -# Metaforecast API - -Modelled roughly after the [Manifold Markets API.](https://manifoldmarkets.notion.site/Manifold-Markets-API-5e7d0aef4dcf452bb04b319e178fabc5). Much as theirs, the metaforecast API is also in alpha. It has at various points been - -## List out all markets - -## Get markets for one particular platform - -## Get history - -Not yet implemented - -// - -https://nextjs.org/docs/messages/api-routes-response-size-limit diff --git a/src/pages/dashboards/embed/[id].tsx b/src/pages/dashboards/embed/[id].tsx index be031e5..8be104c 100644 --- a/src/pages/dashboards/embed/[id].tsx +++ b/src/pages/dashboards/embed/[id].tsx @@ -29,6 +29,7 @@ export const getServerSideProps: GetServerSideProps = async ( return { props: { + // reduntant: page component doesn't do graphql requests, but it's still nice/more consistent to have data in cache urqlState: ssrCache.extractData(), dashboard, numCols: !numCols ? null : numCols < 5 ? numCols : 4, diff --git a/src/pages/dashboards/index.tsx b/src/pages/dashboards/index.tsx index c90e332..b92f00c 100644 --- a/src/pages/dashboards/index.tsx +++ b/src/pages/dashboards/index.tsx @@ -14,7 +14,7 @@ const DashboardsPage: NextPage = () => { ); const handleSubmit = async (data: any) => { - await createDashboard({ + const result = await createDashboard({ input: { title: data.title, description: data.description, @@ -22,8 +22,7 @@ const DashboardsPage: NextPage = () => { ids: data.ids, }, }); - console.log(createDashboardResult); - const dashboardId = createDashboardResult?.data?.result?.dashboard?.id; + const dashboardId = result?.data?.result?.dashboard?.id; if (!dashboardId) { throw new Error("Couldn't create a dashboard"); // TODO - toaster } diff --git a/src/pages/dashboards/view/[id].tsx b/src/pages/dashboards/view/[id].tsx index e3f83af..fa41944 100644 --- a/src/pages/dashboards/view/[id].tsx +++ b/src/pages/dashboards/view/[id].tsx @@ -31,6 +31,7 @@ export const getServerSideProps: GetServerSideProps = async ( return { props: { + // reduntant: page component doesn't do graphql requests, but it's still nice/more consistent to have data in cache urqlState: ssrCache.extractData(), dashboard, }, diff --git a/src/web/display/DashboardCreator.tsx b/src/web/display/DashboardCreator.tsx index 6f49191..133726c 100644 --- a/src/web/display/DashboardCreator.tsx +++ b/src/web/display/DashboardCreator.tsx @@ -60,8 +60,10 @@ Your old input was: ${value}`; You can find the necessary ids by toggling the advanced options in the - search, or by visiting{" "} - /api/all-forecasts + search, or by using{" "} + + GraphQL API +