Skip to content

Commit

Permalink
fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecot committed Jan 4, 2024
1 parent 62b26ac commit a83d0c8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { sql, desc, eq, gt, and, inArray } from "drizzle-orm";
import * as schema from './schema';
import { GetDb } from './utils';
import RequestCache from './queryCache';
import { FastifyRequest, FastifyReply } from 'fastify';

const requestCache = new RequestCache();
let db = GetDb()

Expand Down Expand Up @@ -56,7 +58,7 @@ const latestOpts: RouteShorthandOptions = {
}
}

server.get('/latest', latestOpts, async (request, reply) => {
server.get('/latest', latestOpts, async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

const { latestHeight, latestDatetime } = await getLatestBlock()
Expand Down Expand Up @@ -109,7 +111,7 @@ const indexOpts: RouteShorthandOptions = {
}
}

server.get('/index', indexOpts, requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/index', indexOpts, requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

//
Expand Down Expand Up @@ -308,7 +310,7 @@ const providerOpts: RouteShorthandOptions = {
}
}

server.get('/provider/:addr', providerOpts, requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/provider/:addr', providerOpts, requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

const { addr } = request.params as { addr: string }
Expand Down Expand Up @@ -442,7 +444,7 @@ const providersOpts: RouteShorthandOptions = {
}
}

server.get('/providers', providersOpts, requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/providers', providersOpts, requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

const res = await db.select().from(schema.providers)
Expand Down Expand Up @@ -484,7 +486,7 @@ const consumerOpts: RouteShorthandOptions = {
}
}

server.get('/consumer/:addr', consumerOpts, requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/consumer/:addr', consumerOpts, requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

const { addr } = request.params as { addr: string }
Expand Down Expand Up @@ -587,7 +589,7 @@ const SpecOpts: RouteShorthandOptions = {
}
}

server.get('/spec/:specId', SpecOpts, requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/spec/:specId', SpecOpts, requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {
await checkDb()

const { specId } = request.params as { specId: string }
Expand Down Expand Up @@ -701,7 +703,7 @@ const eventsOpts: RouteShorthandOptions = {
}
}

server.get('/events', eventsOpts, await requestCache.handleRequestWithCache(async (request, reply) => {
server.get('/events', eventsOpts, await requestCache.handleRequestWithCache(async (request: FastifyRequest, reply: FastifyReply) => {

const { latestHeight, latestDatetime } = await getLatestBlock()

Expand Down

0 comments on commit a83d0c8

Please sign in to comment.