diff --git a/src/app/api/block/route.ts b/src/app/api/block/route.ts index 7bf1eff..590c6c5 100644 --- a/src/app/api/block/route.ts +++ b/src/app/api/block/route.ts @@ -1,11 +1,10 @@ +export const dynamic = "force-dynamic"; import { sql } from "@pgtyped/runtime"; import { getPgClient } from "@/lib/db"; import { IGetBlockQuery } from "./route.types"; import { BlockHeightValidator } from "@/lib/validators/search"; import { z } from "zod"; -export const dynamic = "force-dynamic"; - export async function GET(req: Request) { console.log("Sucess: GET /api/block"); try { diff --git a/src/app/api/blocks/route.ts b/src/app/api/blocks/route.ts index aaf3ddf..deb4d78 100644 --- a/src/app/api/blocks/route.ts +++ b/src/app/api/blocks/route.ts @@ -1,10 +1,8 @@ +export const dynamic = "force-dynamic"; import { sql } from "@pgtyped/runtime"; import { IGetBlocksByDescQuery, IGetBlocksCountQuery} from "./route.types"; import { getPgClient } from "@/lib/db"; -// Without forcing no-cache on the route, even downstream components will render stale data without a hard-refresh of the page. This holds true for /transactions as well. -export const dynamic = "force-dynamic"; - export async function POST(req: Request) { console.log("POST req on /api/blocks/"); try { diff --git a/src/app/api/ibc/channel/route.ts b/src/app/api/ibc/channel/route.ts index 6d4c634..23efd1c 100644 --- a/src/app/api/ibc/channel/route.ts +++ b/src/app/api/ibc/channel/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { type NextRequest } from "next/server"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; diff --git a/src/app/api/ibc/channels/route.ts b/src/app/api/ibc/channels/route.ts index 5ae183f..051af32 100644 --- a/src/app/api/ibc/channels/route.ts +++ b/src/app/api/ibc/channels/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { IGetChannelsCountQuery, IGetIbcChannelsQuery } from "./route.types"; diff --git a/src/app/api/ibc/client/route.ts b/src/app/api/ibc/client/route.ts index f75ca62..75e26ad 100644 --- a/src/app/api/ibc/client/route.ts +++ b/src/app/api/ibc/client/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { type NextRequest } from "next/server"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; diff --git a/src/app/api/ibc/clients/route.ts b/src/app/api/ibc/clients/route.ts index 717aadf..319a79c 100644 --- a/src/app/api/ibc/clients/route.ts +++ b/src/app/api/ibc/clients/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { NextRequest } from "next/server"; diff --git a/src/app/api/ibc/connection/route.ts b/src/app/api/ibc/connection/route.ts index 7ca2c31..be2b841 100644 --- a/src/app/api/ibc/connection/route.ts +++ b/src/app/api/ibc/connection/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { type NextRequest } from "next/server"; diff --git a/src/app/api/ibc/connections/route.ts b/src/app/api/ibc/connections/route.ts index 7909f9b..62c7cc5 100644 --- a/src/app/api/ibc/connections/route.ts +++ b/src/app/api/ibc/connections/route.ts @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { IGetConnectionsCountQuery, IGetConnectionsQuery } from "./route.types"; diff --git a/src/app/api/transaction/route.ts b/src/app/api/transaction/route.ts index 9d94480..bf05832 100644 --- a/src/app/api/transaction/route.ts +++ b/src/app/api/transaction/route.ts @@ -1,12 +1,10 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { IGetTransactionQuery } from "./route.types"; import { transactionFromBytes, ibcRegistry } from "@/lib/protobuf"; import { HashResultValidator } from "@/lib/validators/search"; import { z } from "zod"; -// import { } from "@buf/cosmos_ibc.bufbuild_es/ibc/core/client/v1/" - -export const dynamic = "force-dynamic"; export async function GET(req: Request) { console.log("Success: GET /api/transaction"); diff --git a/src/app/api/transactions/route.ts b/src/app/api/transactions/route.ts index 0a548aa..83b5160 100644 --- a/src/app/api/transactions/route.ts +++ b/src/app/api/transactions/route.ts @@ -1,9 +1,8 @@ +export const dynamic = "force-dynamic"; import { getPgClient } from "@/lib/db"; import { sql } from "@pgtyped/runtime"; import { IGetTransactionsCountQuery, IGetTransactionsQuery } from "./route.types"; -export const dynamic = "force-dynamic"; - export async function POST(req: Request) { console.log("Success: POST /api/transactions"); try { diff --git a/src/app/blocks/page.tsx b/src/app/blocks/page.tsx index a4df102..0a12a66 100644 --- a/src/app/blocks/page.tsx +++ b/src/app/blocks/page.tsx @@ -1,9 +1,9 @@ +export const dynamic = "force-dynamic"; import { BlocksTable } from "@/components/BlocksTable"; -import getBlocks from "@/components/BlocksTable/getBlocks"; +import { getBlocks } from "@/components/BlocksTable/getBlocks"; import { getQueryClient } from "@/lib/utils"; import { HydrationBoundary, dehydrate } from "@tanstack/react-query"; -export const dynamic = "force-dynamic"; const Page = () => { const queryClient = getQueryClient(); diff --git a/src/app/ibc/channels/page.tsx b/src/app/ibc/channels/page.tsx index 4f37877..11bccc6 100644 --- a/src/app/ibc/channels/page.tsx +++ b/src/app/ibc/channels/page.tsx @@ -1,10 +1,9 @@ +export const dynamic = "force-dynamic"; import { ChannelsTable } from "@/components/ibc/channels/ChannelsTable"; import { getIbcChannels } from "@/components/ibc/channels/getIbcChannels"; import { getQueryClient } from "@/lib/utils"; import { HydrationBoundary, dehydrate } from "@tanstack/react-query"; - - const Page = () => { const queryClient = getQueryClient(); diff --git a/src/app/ibc/clients/page.tsx b/src/app/ibc/clients/page.tsx index 93e105d..dd74b74 100644 --- a/src/app/ibc/clients/page.tsx +++ b/src/app/ibc/clients/page.tsx @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import { ClientsTable } from "@/components/ibc/clients/ClientsTable"; import { getIbcClients } from "@/components/ibc/clients/getIbcClients"; import { getQueryClient } from "@/lib/utils"; diff --git a/src/app/ibc/connections/page.tsx b/src/app/ibc/connections/page.tsx index 63960d9..3fefcd8 100644 --- a/src/app/ibc/connections/page.tsx +++ b/src/app/ibc/connections/page.tsx @@ -1,3 +1,4 @@ +export const dynamic = "force-dynamic"; import ConnectionsTable from "@/components/ibc/connections/ConnectionsTable"; import { getIbcConnections } from "@/components/ibc/connections/getIbcConnections"; import { getQueryClient } from "@/lib/utils"; diff --git a/src/components/BlocksTable/getBlocks.ts b/src/components/BlocksTable/getBlocks.ts index 9fd6b08..0b27f71 100644 --- a/src/components/BlocksTable/getBlocks.ts +++ b/src/components/BlocksTable/getBlocks.ts @@ -1,6 +1,6 @@ import { BlocksTableQuery } from "@/lib/validators/table"; -export default async function getBlocks ({ endpoint, pageIndex } : ({ endpoint: string, pageIndex: number })) { +export async function getBlocks ({ endpoint, pageIndex } : ({ endpoint: string, pageIndex: number })) { console.log(`Fetching: POST ${endpoint}?page=${pageIndex}`); const res = await fetch(`http://localhost:3000${endpoint}?page=${pageIndex}`, { method: "POST" }); const json = await res.json(); diff --git a/src/components/BlocksTable/index.tsx b/src/components/BlocksTable/index.tsx index dab7d49..acccb8b 100644 --- a/src/components/BlocksTable/index.tsx +++ b/src/components/BlocksTable/index.tsx @@ -5,7 +5,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import { useState } from "react"; import { PaginatedDataTable } from "../ui/paginated-data-table"; import { PaginationState, getCoreRowModel, useReactTable } from "@tanstack/react-table"; -import getBlocks from "./getBlocks"; +import { getBlocks } from "./getBlocks"; import { cn } from "@/lib/utils"; export interface QueryOptions { diff --git a/src/components/Providers/index.tsx b/src/components/Providers/index.tsx index f771d04..6a0612f 100644 --- a/src/components/Providers/index.tsx +++ b/src/components/Providers/index.tsx @@ -14,7 +14,7 @@ export function ThemeProvider({ children, ...props }: ThemeProviderProps) { } const penumbraTransport = createGrpcWebTransport({ - baseUrl: process.env.PENUMBRA_GRPC_ENDPOINT ? process.env.PENUMBRA_GRPC_ENDPOINT : "http://localhost:8080", + baseUrl: process.env?.PENUMBRA_GRPC_ENDPOINT ?? "http://localhost:8080", }); diff --git a/src/components/ibc/channels/getIbcChannels.ts b/src/components/ibc/channels/getIbcChannels.ts index afca459..c28268c 100644 --- a/src/components/ibc/channels/getIbcChannels.ts +++ b/src/components/ibc/channels/getIbcChannels.ts @@ -2,9 +2,6 @@ export async function getIbcChannels({ endpoint, pageIndex } : { endpoint: strin console.log(`Fetching: GET ${endpoint}?page=${pageIndex}`); const res = await fetch(`http://localhost:3000${endpoint}?page=${pageIndex}`, { method: "GET" }); return await res.json(); - // const json = await res.json(); - // console.log("Fetched Result:", json); - // return json; // const result = ChannelsTableData.safeParse(json); // if (result.success) { // return result.data; diff --git a/src/components/ibc/clients/getIbcClients.ts b/src/components/ibc/clients/getIbcClients.ts index 889f2a9..2fd677e 100644 --- a/src/components/ibc/clients/getIbcClients.ts +++ b/src/components/ibc/clients/getIbcClients.ts @@ -1,5 +1,6 @@ export async function getIbcClients({ endpoint, pageIndex } : { endpoint: string, pageIndex: number }) { console.log(`Fetching: GET ${endpoint}?page=${pageIndex}`); const res = await fetch(`http://localhost:3000${endpoint}?page=${pageIndex}`, { method: "GET" }); - return await res.json(); + const json = await res.json(); + return json; }