Skip to content

Commit

Permalink
docs: 📚️ add filter function return type
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-wang0 committed Apr 25, 2024
1 parent ac8c6da commit 53195b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/api/src/routes/v1/rest/websoc/+endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { createHandler } from "@libs/lambda";
import type { WebsocAPIResponse, WebsocSchool } from "@libs/uc-irvine-lib/websoc";
import { notNull } from "@libs/utils";
import { combineAndNormalizeResponses, sortResponse } from "@libs/websoc-utils";
import type { z } from "zod";
import { ZodError } from "zod";

import { APILambdaClient } from "./APILambdaClient";
import { constructPrismaQuery, normalizeQuery } from "./lib";
import { QuerySchema } from "./schema";
import { Query, QuerySchema } from "./schema";

const prisma = new PrismaClient();

Expand Down Expand Up @@ -124,7 +123,7 @@ export const GET = createHandler(async (event, context, res) => {
}
}, onWarm);

function filterResults(query: z.infer<typeof QuerySchema>, websocResults: WebsocAPIResponse) {
function filterResults(query: Query, websocResults: WebsocAPIResponse): WebsocAPIResponse {
if (!query.excludeRestrictionCodes) {
return websocResults;
}
Expand Down

0 comments on commit 53195b4

Please sign in to comment.