Compare commits
2 Commits
feat/impro
...
feat/get-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61d26e4ed8 | ||
|
|
878ffd15fc |
@@ -163,9 +163,9 @@ export const createTRPCRouter = t.router;
|
|||||||
|
|
||||||
export const createCallerFactory = t.createCallerFactory;
|
export const createCallerFactory = t.createCallerFactory;
|
||||||
|
|
||||||
const loggingMiddleware = t.middleware(async ({ path, type, next, ctx, getRawInput }) => {
|
const loggingMiddleware = t.middleware(async ({ path, type, next, ctx }) => {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
const [result, input] = await Promise.all([next(), getRawInput().catch(() => undefined)]);
|
const result = await next();
|
||||||
const duration = Date.now() - start;
|
const duration = Date.now() - start;
|
||||||
|
|
||||||
const { user, transport, requestId } = ctx as {
|
const { user, transport, requestId } = ctx as {
|
||||||
@@ -182,7 +182,6 @@ const loggingMiddleware = t.middleware(async ({ path, type, next, ctx, getRawInp
|
|||||||
duration,
|
duration,
|
||||||
userId: user?.id,
|
userId: user?.id,
|
||||||
...(isCloud && { email: user?.email }),
|
...(isCloud && { email: user?.email }),
|
||||||
input,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const label = transport === "rest" ? "REST" : "tRPC";
|
const label = transport === "rest" ? "REST" : "tRPC";
|
||||||
|
|||||||
Reference in New Issue
Block a user