activity logging middleware
This commit is contained in:
@@ -6,6 +6,7 @@ import { toServerResult } from "@/lib/tanstack-query/utils/to-server-result";
|
||||
import { teamInputSchema, teamUpdateSchema } from "./types";
|
||||
import { logger } from "@/lib/logger";
|
||||
import { Match } from "../matches/types";
|
||||
import { serverFnLoggingMiddleware } from "@/utils/activities";
|
||||
|
||||
|
||||
export const listTeamInfos = createServerFn()
|
||||
@@ -30,7 +31,7 @@ export const getTeamInfo = createServerFn()
|
||||
|
||||
export const createTeam = createServerFn()
|
||||
.inputValidator(teamInputSchema)
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
|
||||
.handler(async ({ data, context }) =>
|
||||
toServerResult(async () => {
|
||||
const userId = context.userAuthId;
|
||||
@@ -50,7 +51,7 @@ export const updateTeam = createServerFn()
|
||||
id: z.string(),
|
||||
updates: teamUpdateSchema
|
||||
}))
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
|
||||
.handler(async ({ data: { id, updates }, context }) =>
|
||||
toServerResult(async () => {
|
||||
const userId = context.userAuthId;
|
||||
|
||||
Reference in New Issue
Block a user