Skip to content

Commit

Permalink
add query_params to /cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Mar 12, 2024
1 parent f230655 commit 493466b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function findLatestCursor(req: Request) {
const { module_hash, chain} = await paramsLatestCursor(req);
logger.info("[sql::findLatestCursor]", { module_hash, chain });
const query = await Bun.file(import.meta.dirname + "/cursor.sql").text()
const response = await readOnlyClient.query({ query, format: "JSONEachRow" });
const response = await readOnlyClient.query({ query, query_params: {module_hash, chain}, format: "JSONEachRow" });
const data = await response.json<Array<{latest_cursor: string}>>();

if (data.length === 1) return data[0].latest_cursor;
Expand Down

0 comments on commit 493466b

Please sign in to comment.