Skip to content

Commit

Permalink
refactor(api): refactor createTRPCContext function and define Context…
Browse files Browse the repository at this point in the history
…Scope type (#696)
  • Loading branch information
luis-herasme authored Jan 28, 2025
1 parent 90a05b3 commit b3a8654
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/api/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ function getIP(req: NodeHTTPRequest | NextHTTPRequest): string | undefined {
return ip;
}

export function createTRPCContext(
{
scope,
}: {
scope: string;
} = { scope: "" }
) {
type ContextScope = "web" | "rest-api";

export function createTRPCContext({ scope }: { scope: ContextScope }) {
return async (opts: CreateContextOptions) => {
try {
const apiClient = retrieveAPIClient(opts.req);
Expand Down

0 comments on commit b3a8654

Please sign in to comment.