Skip to content

Commit a04335f

Browse files
committed
pass to customCtx too
1 parent 2bd9f58 commit a04335f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/convex-helpers/server/customFunctions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ export type Mod<
7272
export function customCtx<
7373
InCtx extends Record<string, any>,
7474
OutCtx extends Record<string, any>,
75+
ExtraArgs extends Record<string, any> = {},
7576
>(
76-
mod: (original: InCtx) => Promise<OutCtx> | OutCtx,
77-
): Mod<InCtx, {}, OutCtx, {}> {
77+
mod: (original: InCtx, extra: ExtraArgs) => Promise<OutCtx> | OutCtx,
78+
): Mod<InCtx, {}, OutCtx, {}, ExtraArgs> {
7879
return {
7980
args: {},
80-
input: async (ctx) => ({ ctx: await mod(ctx), args: {} }),
81+
input: async (ctx, _, extra) => ({ ctx: await mod(ctx, extra), args: {} }),
8182
};
8283
}
8384

0 commit comments

Comments
 (0)